Method: Positionable::InstanceMethods#remove_from_list
- Defined in:
- lib/positionable.rb
#remove_from_list(list_name = :default) ⇒ Object
Removes the record from the list and shift other items accordingly.
201 202 203 204 205 206 207 208 |
# File 'lib/positionable.rb', line 201 def remove_from_list(list_name = :default) if in_list? acts_as_positionable_class.transaction do decrement_positions_on_lower_items(list_name) update_attribute position_column(list_name), nil end end end |