From a6414b6dbed387aa0cb738ac6ffc4fb7a10b8fe0 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 10 Apr 2020 20:14:14 +0200 Subject: [PATCH] Make sure taggable_type is 'Customer' when querying customer tags --- app/controllers/admin/customers_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/customers_controller.rb b/app/controllers/admin/customers_controller.rb index 91eda7d4a7..dac3b209dc 100644 --- a/app/controllers/admin/customers_controller.rb +++ b/app/controllers/admin/customers_controller.rb @@ -96,7 +96,10 @@ module Admin customer_tags = ::ActsAsTaggableOn::Tag. joins(:taggings). includes(:taggings). - where(taggings: { taggable_id: Customer.of(managed_enterprise_id), context: 'tags' }) + where(taggings: + { taggable_type: 'Customer', + taggable_id: Customer.of(managed_enterprise_id), + context: 'tags' }) customer_tags.each_with_object({}) do |tag, indexed_hash| customer_id = tag.taggings.first.taggable_id