Method: ActsAsList::InstanceMethods#move_to_top
- Defined in:
- lib/acts_as_list.rb
#move_to_top ⇒ Object
Move to the top of the list. If the item is already in the list, the items above it have their position adjusted accordingly.
112 113 114 115 116 117 118 |
# File 'lib/acts_as_list.rb', line 112 def move_to_top return unless in_list? acts_as_list_class.transaction do increment_positions_on_higher_items assume_top_position end end |