diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-25 22:42:19 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-25 22:42:19 +0000 |
commit | 89c79b8b9537b5ae8a4d3307e719b6ff6acef6f2 (patch) | |
tree | ce2070759e2d5e218aebe76b34cfb7cb821ddbf9 /activerecord/test/fixtures | |
parent | 3aadfcef88e57b3f0a0bde9a2bc05d372e2fd93b (diff) | |
download | rails-89c79b8b9537b5ae8a4d3307e719b6ff6acef6f2.tar.gz rails-89c79b8b9537b5ae8a4d3307e719b6ff6acef6f2.tar.bz2 rails-89c79b8b9537b5ae8a4d3307e719b6ff6acef6f2.zip |
Fix polymorphic has_one associations declared in an abstract class. Closes #8638.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7119 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r-- | activerecord/test/fixtures/db_definitions/schema.rb | 4 | ||||
-rw-r--r-- | activerecord/test/fixtures/item.rb | 7 | ||||
-rw-r--r-- | activerecord/test/fixtures/items.yml | 4 | ||||
-rw-r--r-- | activerecord/test/fixtures/taggings.yml | 9 |
4 files changed, 23 insertions, 1 deletions
diff --git a/activerecord/test/fixtures/db_definitions/schema.rb b/activerecord/test/fixtures/db_definitions/schema.rb index 3dc9a9b8a3..cdebcbbe5f 100644 --- a/activerecord/test/fixtures/db_definitions/schema.rb +++ b/activerecord/test/fixtures/db_definitions/schema.rb @@ -57,6 +57,10 @@ ActiveRecord::Schema.define do create_table :lock_without_defaults_cust, :force => true do |t| t.column :custom_lock_version, :integer end + + create_table :items, :force => true do |t| + t.column :name, :integer + end # For sqlite 3.1.0+, make a table with a autoincrement column if adapter_name == 'SQLite' and supports_autoincrement? diff --git a/activerecord/test/fixtures/item.rb b/activerecord/test/fixtures/item.rb new file mode 100644 index 0000000000..c2571dd7fb --- /dev/null +++ b/activerecord/test/fixtures/item.rb @@ -0,0 +1,7 @@ +class AbstractItem < ActiveRecord::Base + self.abstract_class = true + has_one :tagging, :as => :taggable +end + +class Item < AbstractItem +end diff --git a/activerecord/test/fixtures/items.yml b/activerecord/test/fixtures/items.yml new file mode 100644 index 0000000000..31fd657df9 --- /dev/null +++ b/activerecord/test/fixtures/items.yml @@ -0,0 +1,4 @@ +dvd: + id: 1 + name: Godfather +
\ No newline at end of file diff --git a/activerecord/test/fixtures/taggings.yml b/activerecord/test/fixtures/taggings.yml index 617210d604..2213b15494 100644 --- a/activerecord/test/fixtures/taggings.yml +++ b/activerecord/test/fixtures/taggings.yml @@ -15,4 +15,11 @@ fake: id: 3 tag_id: 1 taggable_id: 1 - taggable_type: FakeModel
\ No newline at end of file + taggable_type: FakeModel + +godfather: + id: 4 + tag_id: 1 + taggable_id: 1 + taggable_type: Item +
\ No newline at end of file |