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.
    
  • without_validations

    When it is true, validations will be skipped
    


72
73
74
75
# File 'app/models/rails_sortable/model.rb', line 72

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