Module: ActsAsRankedList::ActiveRecord::Service
- Defined in:
- lib/acts_as_ranked_list/active_record/service.rb
Defined Under Namespace
Modules: InstanceMethods
Class Method Summary collapse
-
.acts_as_ranked_list(user_options = {}) ⇒ void
Add
acts_as_ranked_listto an::ActiveRecordmodel to use this gem.
Class Method Details
.acts_as_ranked_list(user_options = {}) ⇒ void
This method returns an undefined value.
Add acts_as_ranked_list to an ::ActiveRecord model to use this gem.
Please refer to the README for complete usage and examples.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/acts_as_ranked_list/active_record/service.rb', line 51 def acts_as_ranked_list( = {}) = { column: "rank", touch_on_update: true, step_increment: 1024, avoid_collisions: true, new_item_at: :lowest, scopes: {} } .update() ::ActsAsRankedList::ActiveRecord::PersistenceCallback.call(self) ::ActsAsRankedList::ActiveRecord::RankColumn.call(self, [:column], [:touch_on_update], [:step_increment], [:avoid_collisions], [:new_item_at], [:scopes]) include ::ActsAsRankedList::ActiveRecord::Service::InstanceMethods include ::ActsAsRankedList::ActiveRecord::SkipPersistence include ::ActsAsRankedList::ActiveRecord::AvoidCollisions end |