diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-16 02:49:18 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-16 02:49:18 +0000 |
commit | 1f916a119ca5c61174cb58124ea989c1e8b00fd4 (patch) | |
tree | a21bc3c8990c5fb6364ff04cc1b3bcd59a8ba27e /activerecord/test/fixtures | |
parent | 8bc82278dddfe23d84ac24ffe83f92c816028dd8 (diff) | |
download | rails-1f916a119ca5c61174cb58124ea989c1e8b00fd4.tar.gz rails-1f916a119ca5c61174cb58124ea989c1e8b00fd4.tar.bz2 rails-1f916a119ca5c61174cb58124ea989c1e8b00fd4.zip |
Added that Active Records will automatically record creation and/or update timestamps of database objects if fields of the names created_at/created_on or updated_at/updated_on are present. [Tobias Luetke] Added acts_as_tree that can decorates an existing class with a many to many relationship with itself. Added acts_as_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@176 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r-- | activerecord/test/fixtures/mixin.rb | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/activerecord/test/fixtures/mixin.rb b/activerecord/test/fixtures/mixin.rb index 589c1a8c23..8cae604140 100644 --- a/activerecord/test/fixtures/mixin.rb +++ b/activerecord/test/fixtures/mixin.rb @@ -1,21 +1,13 @@ class Mixin < ActiveRecord::Base - include ActiveRecord::Mixins::Touch - include ActiveRecord::Mixins::Tree + acts_as_tree :foreign_key => "parent_id", :order => "id" + end class ListMixin < ActiveRecord::Base - include ActiveRecord::Mixins::List - + acts_as_list :column => "pos", :scope => :parent_id + def self.table_name "mixins" end - def scope_condition - "parent_id = #{self.parent_id}" - end - - def position_column - "pos" - end - end
\ No newline at end of file |