diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-03-19 07:14:48 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-03-19 07:14:48 +0000 |
commit | fcd4c9529c071d3c77cbf57fe733869da0d3fde8 (patch) | |
tree | 76b40bc3ed6d210edfb33a7c09d428d160c12e10 /activerecord/test/fixtures | |
parent | 8ea1fadcbeefeb1b7f4bc46c083b0c761cde41e3 (diff) | |
download | rails-fcd4c9529c071d3c77cbf57fe733869da0d3fde8.tar.gz rails-fcd4c9529c071d3c77cbf57fe733869da0d3fde8.tar.bz2 rails-fcd4c9529c071d3c77cbf57fe733869da0d3fde8.zip |
Allow has_many :through associations to find the source association by setting a custom class (closes #4307) [jonathan@bluewire.net.nz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3973 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r-- | activerecord/test/fixtures/author.rb | 1 | ||||
-rw-r--r-- | activerecord/test/fixtures/post.rb | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/fixtures/author.rb b/activerecord/test/fixtures/author.rb index 1a7aa6e388..1dda0f837c 100644 --- a/activerecord/test/fixtures/author.rb +++ b/activerecord/test/fixtures/author.rb @@ -4,6 +4,7 @@ class Author < ActiveRecord::Base has_many :posts_with_categories, :include => :categories, :class_name => "Post" has_many :posts_with_comments_and_categories, :include => [ :comments, :categories ], :order => "posts.id", :class_name => "Post" has_many :comments, :through => :posts + has_many :funky_comments, :through => :posts, :class_name => 'Comment' has_many :special_posts, :class_name => "Post" has_many :hello_posts, :class_name => "Post", :conditions=>"\#{aliased_table_name}.body = 'hello'" diff --git a/activerecord/test/fixtures/post.rb b/activerecord/test/fixtures/post.rb index 23f4b5d8a5..eca9369723 100644 --- a/activerecord/test/fixtures/post.rb +++ b/activerecord/test/fixtures/post.rb @@ -22,6 +22,7 @@ class Post < ActiveRecord::Base has_many :taggings, :as => :taggable has_many :tags, :through => :taggings + has_many :funky_tags, :through => :taggings, :class_name => 'Tag' has_many :super_tags, :through => :taggings has_one :tagging, :as => :taggable |