socialforge/lib/plugins/acts_as_list
nigel007 9e642b8627 remove some test after copying from hjq 2019-04-11 19:42:40 +08:00
..
lib/active_record/acts remove some test after copying from hjq 2019-04-11 19:42:40 +08:00
test remove some test after copying from hjq 2019-04-11 19:42:40 +08:00
README remove some test after copying from hjq 2019-04-11 19:42:40 +08:00
init.rb remove some test after copying from hjq 2019-04-11 19:42:40 +08:00

README

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

ActsAsList
==========

This acts_as extension provides the capabilities for sorting and reordering a number of objects in a list. The class that has this specified needs to have a +position+ column defined as an integer on the mapped database table.


Example
=======

  class TodoList < ActiveRecord::Base
    has_many :todo_items, :order => "position"
  end

  class TodoItem < ActiveRecord::Base
    belongs_to :todo_list
    acts_as_list :scope => :todo_list
  end

  todo_list.first.move_to_bottom
  todo_list.last.move_higher


Copyright (c) 2007 David Heinemeier Hansson, released under the MIT license