Module: RailsSortable::Model::ClassMethods

Defined in:
app/models/rails_sortable/model.rb

Instance Method Summary collapse

Instance Method Details

#set_sortable(attribute, options = {}) ⇒ Object

allowed options

  • without_updating_timestamps

    When it is true, timestamp(updated_at) will be NOT touched on reordering.
    


65
66
67
68
# File 'app/models/rails_sortable/model.rb', line 65

def set_sortable(attribute, options = {})
  self.define_singleton_method(:sort_attribute) { attribute }
  self.define_singleton_method(:sortable_options) { options }
end