Method: Qbrick::Orderable::InstanceMethods#set_position
- Defined in:
- lib/qbrick/orderable.rb
#set_position ⇒ Object
59 60 61 62 |
# File 'lib/qbrick/orderable.rb', line 59 def set_position initial_position = siblings.blank? ? 1 : siblings.count + 1 update_attribute(:position, initial_position) end |