Mercurial > hg > soundsoftware-site
comparison lib/plugins/acts_as_list/README @ 1115:433d4f72a19b redmine-2.2
Update to Redmine SVN revision 11137 on 2.2-stable branch
author | Chris Cannam |
---|---|
date | Mon, 07 Jan 2013 12:01:42 +0000 |
parents | vendor/plugins/acts_as_list/README@513646585e45 |
children |
comparison
equal
deleted
inserted
replaced
929:5f33065ddc4b | 1115:433d4f72a19b |
---|---|
1 ActsAsList | |
2 ========== | |
3 | |
4 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. | |
5 | |
6 | |
7 Example | |
8 ======= | |
9 | |
10 class TodoList < ActiveRecord::Base | |
11 has_many :todo_items, :order => "position" | |
12 end | |
13 | |
14 class TodoItem < ActiveRecord::Base | |
15 belongs_to :todo_list | |
16 acts_as_list :scope => :todo_list | |
17 end | |
18 | |
19 todo_list.first.move_to_bottom | |
20 todo_list.last.move_higher | |
21 | |
22 | |
23 Copyright (c) 2007 David Heinemeier Hansson, released under the MIT license |