Method: Sequel::Plugins::List::InstanceMethods#after_destroy
- Defined in:
- lib/sequel/plugins/list.rb
#after_destroy ⇒ Object
When destroying an instance, move all entries after the instance down one position, so that there aren’t any gaps
106 107 108 109 110 111 |
# File 'lib/sequel/plugins/list.rb', line 106 def after_destroy super f = Sequel[position_field] list_dataset.where(f > position_value).update(f => f - 1) end |