Skip to content
This repository
Browse code

call .quote_value with column-parameter in patch #1362

  • Loading branch information...
commit d3cfb939e18f98e7b54015dd4d71160f9069e240 1 parent 1df2286
Marcel Jackwerth authored May 27, 2011
4  activerecord/lib/active_record/associations/through_association_scope.rb
@@ -30,7 +30,9 @@ def construct_conditions
30 30
       # Associate attributes pointing to owner, quoted.
31 31
       def construct_quoted_owner_attributes(reflection)
32 32
         if as = reflection.options[:as]
33  
-          { "#{as}_id"   => @owner.class.quote_value(@owner[reflection.active_record_primary_key]),
  33
+          { "#{as}_id"   => @owner.class.quote_value(
  34
+              @owner[reflection.active_record_primary_key],
  35
+              reflection.klass.columns_hash["#{as}_id"]),
34 36
             "#{as}_type" => reflection.klass.quote_value(
35 37
               @owner.class.base_class.name.to_s,
36 38
               reflection.klass.columns_hash["#{as}_type"]) }

0 notes on commit d3cfb93

Please sign in to comment.
Something went wrong with that request. Please try again.