diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-10 06:19:50 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-10 06:19:50 +0000 |
commit | b84a7beb98a1bfe384e92d7c301db0ee30cbf1b6 (patch) | |
tree | 289ee3897ba72bd1cd45aaed9bac774e89d2ac4d /activerecord/test/fixtures | |
parent | adba18106081f55f2e8761b5104d295cacd6a8c6 (diff) | |
download | rails-b84a7beb98a1bfe384e92d7c301db0ee30cbf1b6.tar.gz rails-b84a7beb98a1bfe384e92d7c301db0ee30cbf1b6.tar.bz2 rails-b84a7beb98a1bfe384e92d7c301db0ee30cbf1b6.zip |
acts_as_list plays nicely with inheritance by remembering the class which declared it. Closes #2811.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2964 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r-- | activerecord/test/fixtures/mixin.rb | 6 | ||||
-rw-r--r-- | activerecord/test/fixtures/mixins.yml | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/fixtures/mixin.rb b/activerecord/test/fixtures/mixin.rb index a0a92c4f64..0411c0d87e 100644 --- a/activerecord/test/fixtures/mixin.rb +++ b/activerecord/test/fixtures/mixin.rb @@ -16,6 +16,12 @@ class ListMixin < Mixin def self.table_name() "mixins" end end +class ListMixinSub1 < ListMixin +end + +class ListMixinSub2 < ListMixin +end + class ListWithStringScopeMixin < ActiveRecord::Base acts_as_list :column => "pos", :scope => 'parent_id = #{parent_id}' diff --git a/activerecord/test/fixtures/mixins.yml b/activerecord/test/fixtures/mixins.yml index 7b20965512..cb21349cd0 100644 --- a/activerecord/test/fixtures/mixins.yml +++ b/activerecord/test/fixtures/mixins.yml @@ -78,3 +78,12 @@ tree_<%= set[0] %>: root_id: 42 <% end %> + +# subclasses of list items +<% (1..4).each do |i| %> +list_sub_<%= i %>: + id: <%= i + 5000 %> + pos: <%= i %> + parent_id: 5000 + type: <%= (i % 2 == 1) ? ListMixinSub1 : ListMixinSub2 %> +<% end %> |