diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-08 16:02:18 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-08 16:02:18 +0000 |
commit | 1cf7eb1ca84a65fead68104572bc2cbac1fe95a0 (patch) | |
tree | 4d989fefdeb707d51af4e57f99bd5f67aa53960b /activerecord/lib | |
parent | 55be0a3cb518b345fa659629c4f2829faf745fab (diff) | |
download | rails-1cf7eb1ca84a65fead68104572bc2cbac1fe95a0.tar.gz rails-1cf7eb1ca84a65fead68104572bc2cbac1fe95a0.tar.bz2 rails-1cf7eb1ca84a65fead68104572bc2cbac1fe95a0.zip |
Added ActiveRecord::Mixins::List that can decorates an existing class with methods like move_higher/lower, move_to_top/bottom
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@84 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/mixins/list.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/mixins/list.rb b/activerecord/lib/active_record/mixins/list.rb index 1965c46be6..a357312105 100644 --- a/activerecord/lib/active_record/mixins/list.rb +++ b/activerecord/lib/active_record/mixins/list.rb @@ -1,4 +1,7 @@ module ActiveRecord + # Mixins are a way of decorating existing Active Record models with additional behavior. If you for example + # want to keep a number of Documents in order, you can include Mixins::List, and all of the sudden be able to + # call <tt>document.move_to_bottom</tt>. module Mixins # This mixin provides the capabilities for sorting and reordering a number of objects in list. # The class that has this mixin included needs to have a "position" column defined as an integer on @@ -12,7 +15,7 @@ module ActiveRecord # end # # class TodoItem < ActiveRecord::Base - # include ListMixin + # include ActiveRecord::Mixins::List # belongs_to :todo_list # # private |