mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
Dont be ambigious about the condition key
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1896 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user