From 489abfd3b23f3c4b3de86aeb3bde3970771c001b Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Mon, 20 Apr 2009 13:51:11 +0100 Subject: Ensure JoinAssociation uses aliased table name when multiple associations have hash conditions on the same table --- activerecord/test/models/author.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/test/models/author.rb') diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb index 4ffac4fe32..669c664bf4 100644 --- a/activerecord/test/models/author.rb +++ b/activerecord/test/models/author.rb @@ -25,6 +25,8 @@ class Author < ActiveRecord::Base has_many :comments_with_order_and_conditions, :through => :posts, :source => :comments, :order => 'comments.body', :conditions => "comments.body like 'Thank%'" has_many :comments_with_include, :through => :posts, :source => :comments, :include => :post + has_many :thinking_posts, :class_name => 'Post', :conditions => { :title => 'So I was thinking' } + has_many :welcome_posts, :class_name => 'Post', :conditions => { :title => 'Welcome to the weblog' } has_many :comments_desc, :through => :posts, :source => :comments, :order => 'comments.id DESC' has_many :limited_comments, :through => :posts, :source => :comments, :limit => 1 -- cgit v1.2.3