Class: Callbacks::Form::FieldAfterCreate
- Inherits:
-
Object
- Object
- Callbacks::Form::FieldAfterCreate
- Includes:
- Restrictor
- Defined in:
- app/models/callbacks/form/field_after_create.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'app/models/callbacks/form/field_after_create.rb', line 6 def call range = m.position..Float::INFINITY query = m.fields.where(position: range) query.each.with_index(m.position) do |field, position| field.update_column(:position, position) end m.update_header end |