Refactor #product_properties not to fetch ids

This commit is contained in:
Pau Perez
2018-11-26 13:57:19 +01:00
parent bc7258d43b
commit 8e1f9a1ba3

View File

@@ -75,7 +75,9 @@ class Api::CachedEnterpriseSerializer < ActiveModel::Serializer
end
def product_properties
Spree::Property.applied_by(object)
Spree::Property
.joins(product_properties: { product: :supplier })
.where(spree_products: { supplier_id: enterprise })
end
def producer_properties