diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-22 20:22:55 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-22 20:22:55 +0000 |
commit | eb107425819d5b8e15cb41c2b955096c98ccdb2c (patch) | |
tree | a54401382a4e9ff5bc40f88c4172462c86c95454 /activerecord/lib | |
parent | 0223565a4d4a62447e59d69a4da7cfa184531134 (diff) | |
download | rails-eb107425819d5b8e15cb41c2b955096c98ccdb2c.tar.gz rails-eb107425819d5b8e15cb41c2b955096c98ccdb2c.tar.bz2 rails-eb107425819d5b8e15cb41c2b955096c98ccdb2c.zip |
Dont be ambigious about the condition key
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1896 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 3 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index 3b7f2df870..932e8e2aae 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -107,12 +107,11 @@ module ActiveRecord end private - def method_missing(method, *args, &block) if @target.respond_to?(method) or (not @association_class.respond_to?(method) and Class.respond_to?(method)) super else - @association_class.constrain( :conditions => @finder_sql, :joins => @join_sql) { @association_class.send(method, *args, &block) } + @association_class.constrain(:conditions => @finder_sql, :joins => @join_sql) { @association_class.send(method, *args, &block) } end end diff --git a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb index 7d85a2268b..c4eead0e56 100644 --- a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +++ b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb @@ -161,7 +161,7 @@ module ActiveRecord if @options[:finder_sql] @finder_sql = @options[:finder_sql] else - @finder_sql = "#{@association_class_primary_key_name} = #{@owner.quoted_id} " + @finder_sql = "#{@join_table}.#{@association_class_primary_key_name} = #{@owner.quoted_id} " @finder_sql << " AND #{interpolate_sql(@options[:conditions])}" if @options[:conditions] end |