Module: Orderable::ActiveRecordAdditions
- Defined in:
- lib/orderable.rb
Instance Method Summary collapse
Instance Method Details
#orderable(options = {}) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/orderable.rb', line 7 def orderable( = {}) allowed_attrs = [:by] || {} default_attr = [:default] || allowed_attrs.first named_scope :order, lambda { |*attrs| do_order_by(attrs.shift, attrs.shift || {}, allowed_attrs, default_attr) } end |