mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-17 00:07:24 +00:00
Make sure taggable_type is 'Customer' when querying customer tags
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user