Adding method for determining variant override hubs

This commit is contained in:
Rob Harrington
2015-03-20 00:32:05 +11:00
parent 81765de7a7
commit d8c4e292c8
3 changed files with 7 additions and 3 deletions

View File

@@ -49,6 +49,10 @@ module OpenFoodNetwork
managed_and_related_enterprises_with :edit_profile
end
def variant_override_hubs
managed_and_related_enterprises_with(:add_to_order_cycle).is_hub
end
def variant_override_producers
producer_ids = variant_override_enterprises_per_hub.values.flatten.uniq
Enterprise.where(id: producer_ids)