aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures
diff options
context:
space:
mode:
authorTobias Lütke <tobias.luetke@gmail.com>2005-12-16 23:24:58 +0000
committerTobias Lütke <tobias.luetke@gmail.com>2005-12-16 23:24:58 +0000
commit5f06c483ca6a0434409aa12ec272654bc26735dd (patch)
tree4d4e05b12d3aa659550e972f65ae5e2712869ff8 /activerecord/test/fixtures
parent85fe1ecaefe415ac1de36883f5f6162f49bd5287 (diff)
downloadrails-5f06c483ca6a0434409aa12ec272654bc26735dd.tar.gz
rails-5f06c483ca6a0434409aa12ec272654bc26735dd.tar.bz2
rails-5f06c483ca6a0434409aa12ec272654bc26735dd.zip
Fixed :through relations when using STI inherited classes would use the inherited class's name as foreign key on the join model
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3315 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r--activerecord/test/fixtures/categorizations.yml8
-rw-r--r--activerecord/test/fixtures/category.rb3
-rw-r--r--activerecord/test/fixtures/taggings.yml6
-rw-r--r--activerecord/test/fixtures/tags.yml6
4 files changed, 21 insertions, 2 deletions
diff --git a/activerecord/test/fixtures/categorizations.yml b/activerecord/test/fixtures/categorizations.yml
index a93fd6b79e..f8701fbde0 100644
--- a/activerecord/test/fixtures/categorizations.yml
+++ b/activerecord/test/fixtures/categorizations.yml
@@ -2,4 +2,10 @@ david_welcome_general:
id: 1
author_id: 1
post_id: 1
- category_id: 1 \ No newline at end of file
+ category_id: 1
+
+mary_thinking_sti:
+ id: 2
+ author_id: 2
+ post_id: 2
+ category_id: 3 \ No newline at end of file
diff --git a/activerecord/test/fixtures/category.rb b/activerecord/test/fixtures/category.rb
index 880eb1573d..01938d1405 100644
--- a/activerecord/test/fixtures/category.rb
+++ b/activerecord/test/fixtures/category.rb
@@ -4,6 +4,9 @@ class Category < ActiveRecord::Base
def self.what_are_you
'a category...'
end
+
+ has_many :categorizations
+ has_many :authors, :through => :categorizations
end
class SpecialCategory < Category
diff --git a/activerecord/test/fixtures/taggings.yml b/activerecord/test/fixtures/taggings.yml
index ca171346f1..dced625580 100644
--- a/activerecord/test/fixtures/taggings.yml
+++ b/activerecord/test/fixtures/taggings.yml
@@ -3,3 +3,9 @@ welcome_general:
tag_id: 1
taggable_id: 1
taggable_type: Post
+
+thinking_general:
+ id: 2
+ tag_id: 1
+ taggable_id: 2
+ taggable_type: Post
diff --git a/activerecord/test/fixtures/tags.yml b/activerecord/test/fixtures/tags.yml
index 2a494089ff..471b96f362 100644
--- a/activerecord/test/fixtures/tags.yml
+++ b/activerecord/test/fixtures/tags.yml
@@ -1,3 +1,7 @@
general:
id: 1
- name: General \ No newline at end of file
+ name: General
+
+misc:
+ id: 2
+ name: Misc \ No newline at end of file