Module: Rankle::InstanceMethods
- Defined in:
- lib/rankle.rb
Overview
instance methods added to ActiveRecord models
Instance Method Summary collapse
- #position(name = :default) ⇒ Object
-
#position=(position) ⇒ Integer or Exception
Assigns an explicit position to the record using the default ranker.
- #rank(name = :default, position) ⇒ Object
- #set_default_position ⇒ Object
Instance Method Details
#position(name = :default) ⇒ Object
53 54 55 |
# File 'lib/rankle.rb', line 53 def position name = :default RankleIndex.position self, name end |
#position=(position) ⇒ Integer or Exception
Assigns an explicit position to the record using the default ranker
45 46 47 |
# File 'lib/rankle.rb', line 45 def position= position rank position end |
#rank(name = :default, position) ⇒ Object
49 50 51 |
# File 'lib/rankle.rb', line 49 def rank name = :default, position RankleIndex.rank self, name, position end |
#set_default_position ⇒ Object
37 38 39 |
# File 'lib/rankle.rb', line 37 def set_default_position RankleIndex.set_default_position self end |