From 18cec289b61927cfdbd5edeff9f6015677403dbd Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Mon, 15 Oct 2018 11:01:42 +0200 Subject: [PATCH] Fixed bug: Having multiple associations to different attributes of one Model lead to invalid association data. --- app/models/application_model/can_associations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/application_model/can_associations.rb b/app/models/application_model/can_associations.rb index feadc3d05..d8926c0da 100644 --- a/app/models/application_model/can_associations.rb +++ b/app/models/application_model/can_associations.rb @@ -134,7 +134,7 @@ returns next if association_attributes_ignored.include?(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") end