Permalink
Browse files

Dont be ambigious about the condition key

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1896 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 0223565 commit eb107425819d5b8e15cb41c2b955096c98ccdb2c @dhh dhh committed Jul 22, 2005
@@ -107,12 +107,11 @@ def replace(other_array)
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 @@ def construct_sql
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

0 comments on commit eb10742

Please sign in to comment.