Module: Rexport::ExportItemMethods::ClassMethods

Defined in:
lib/rexport/export_item_methods.rb

Instance Method Summary collapse

Instance Method Details

#resort(export_item_ids) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/rexport/export_item_methods.rb', line 17

def resort(export_item_ids)
  export_item_ids.each_index do |index|
    position = index + 1
    export_item = find(export_item_ids[index].gsub(/[^0-9]/,''))
    export_item.update_attribute(:position, position) if export_item.position != position
  end
end