mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-02 21:57:17 +00:00
Merge pull request #4907 from luisramos0/3-0-enterprise_relationship
[Spree 2.1] Uncomment Enterprise#relate_to_owners_enterprises
This commit is contained in:
@@ -433,21 +433,21 @@ class Enterprise < ActiveRecord::Base
|
||||
# We grant permissions to all pre-existing hubs
|
||||
hub_permissions = [:add_to_order_cycle]
|
||||
hub_permissions << :create_variant_overrides if is_primary_producer
|
||||
#enterprises.is_hub.each do |enterprise|
|
||||
# EnterpriseRelationship.create!(parent: self,
|
||||
# child: enterprise,
|
||||
# permissions_list: hub_permissions)
|
||||
#end
|
||||
enterprises.is_hub.each do |enterprise|
|
||||
EnterpriseRelationship.create!(parent: self,
|
||||
child: enterprise,
|
||||
permissions_list: hub_permissions)
|
||||
end
|
||||
|
||||
# All pre-existing producers grant permission to new hubs
|
||||
#if is_hub
|
||||
# enterprises.is_primary_producer.each do |enterprise|
|
||||
# EnterpriseRelationship.create!(parent: enterprise,
|
||||
# child: self,
|
||||
# permissions_list: [:add_to_order_cycle,
|
||||
# :create_variant_overrides])
|
||||
# end
|
||||
#end
|
||||
if is_hub
|
||||
enterprises.is_primary_producer.each do |enterprise|
|
||||
EnterpriseRelationship.create!(parent: enterprise,
|
||||
child: self,
|
||||
permissions_list: [:add_to_order_cycle,
|
||||
:create_variant_overrides])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def shopfront_taxons
|
||||
|
||||
Reference in New Issue
Block a user