Skip to content
Browse files

call .quote_value with column-parameter in patch #1362

  • Loading branch information...
1 parent 1df2286 commit d3cfb939e18f98e7b54015dd4d71160f9069e240 @sirlantis sirlantis committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/associations/through_association_scope.rb
View
4 activerecord/lib/active_record/associations/through_association_scope.rb
@@ -30,7 +30,9 @@ def construct_conditions
# Associate attributes pointing to owner, quoted.
def construct_quoted_owner_attributes(reflection)
if as = reflection.options[:as]
- { "#{as}_id" => @owner.class.quote_value(@owner[reflection.active_record_primary_key]),
+ { "#{as}_id" => @owner.class.quote_value(
+ @owner[reflection.active_record_primary_key],
+ reflection.klass.columns_hash["#{as}_id"]),
"#{as}_type" => reflection.klass.quote_value(
@owner.class.base_class.name.to_s,
reflection.klass.columns_hash["#{as}_type"]) }

0 comments on commit d3cfb93

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