Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

quoting id columns when doing hm:t joins. fixes #1322

  • Loading branch information...
commit 179a8a46f91f71c2b0a7d306abbfc4259b61e717 1 parent 579d044
@tenderlove tenderlove authored
View
4 activerecord/lib/active_record/associations/through_association_scope.rb
@@ -37,7 +37,9 @@ def construct_quoted_owner_attributes(reflection)
elsif reflection.macro == :belongs_to
{ reflection.klass.primary_key => @owner.class.quote_value(@owner[reflection.primary_key_name]) }
else
- { reflection.primary_key_name => @owner[reflection.active_record_primary_key] }
+ column = @owner.class.columns_hash[reflection.active_record_primary_key]
+
+ { reflection.primary_key_name => @owner.class.quote_value(@owner[reflection.active_record_primary_key], column) }
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.