Sha256: 5b5ceeb1b8013975325a01d485c9580b7c25b8ecdf8f4cdcc98418d1426216ce
Contents?: true
Size: 340 Bytes
Versions: 24
Compression:
Stored size: 340 Bytes
Contents
module Forge module Reorderable def self.included(mod) mod.extend(ClassMethods) end module ClassMethods def reorder!(list) list.each_with_index do |id,order| item = self.find_by_id(id) item.list_order = order and item.save unless item.blank? end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems