Fixed bug: Having multiple associations to different attributes of one Model lead to invalid association data.

This commit is contained in:
Thorsten Eckel 2018-10-15 11:01:42 +02:00
parent ea12b0f676
commit 18cec289b6

View file

@ -134,7 +134,7 @@ returns
next if association_attributes_ignored.include?(assoc_name) next if association_attributes_ignored.include?(assoc_name)
eager_load.push(assoc_name) eager_load.push(assoc_name)
pluck.push("#{assoc.table_name}.id") pluck.push("#{assoc.table_name}.id AS #{assoc_name}")
keys.push("#{assoc_name.to_s.singularize}_ids") keys.push("#{assoc_name.to_s.singularize}_ids")
end end