mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge pull request #12872 from mkllnk/enterprise-serialiser
Clean up enterprise serialiser for shop page speed
This commit is contained in:
@@ -95,9 +95,7 @@ module Api
|
||||
.merge(Exchange.to_enterprise(enterprise))
|
||||
.select('DISTINCT spree_properties.*')
|
||||
|
||||
return properties.merge(OrderCycle.active) if active
|
||||
|
||||
properties
|
||||
properties.merge(OrderCycle.active)
|
||||
end
|
||||
|
||||
def distributed_producer_properties
|
||||
@@ -106,16 +104,14 @@ module Api
|
||||
properties = Spree::Property
|
||||
.joins(
|
||||
producer_properties: {
|
||||
producer: { supplied_products: { variants: { exchanges: :order_cycle } } }
|
||||
producer: { supplied_variants: { exchanges: :order_cycle } }
|
||||
}
|
||||
)
|
||||
.merge(Exchange.outgoing)
|
||||
.merge(Exchange.to_enterprise(enterprise))
|
||||
.select('DISTINCT spree_properties.*')
|
||||
|
||||
return properties.merge(OrderCycle.active) if active
|
||||
|
||||
properties
|
||||
properties.merge(OrderCycle.active)
|
||||
end
|
||||
|
||||
def active
|
||||
|
||||
Reference in New Issue
Block a user