From bdd88810c1edf8289801f88170eb5c9659b2f774 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 28 Mar 2008 16:13:57 +0000 Subject: Fixed that has_many :through would ignore the hash conditions (closes #11447) [miloops] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9110 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/models/author.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/test/models/author.rb') diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb index 79a121b4a4..2918139f7f 100644 --- a/activerecord/test/models/author.rb +++ b/activerecord/test/models/author.rb @@ -35,6 +35,11 @@ class Author < ActiveRecord::Base has_many :hello_post_comments, :through => :hello_posts, :source => :comments has_many :posts_with_no_comments, :class_name => 'Post', :conditions => 'comments.id is null', :include => :comments + has_many :hello_posts_with_hash_conditions, :class_name => "Post", +:conditions => {:body => 'hello'} + has_many :hello_post_comments_with_hash_conditions, :through => +:hello_posts_with_hash_conditions, :source => :comments + has_many :other_posts, :class_name => "Post" has_many :posts_with_callbacks, :class_name => "Post", :before_add => :log_before_adding, :after_add => :log_after_adding, -- cgit v1.2.3