Merge pull request #4907 from luisramos0/3-0-enterprise_relationship

[Spree 2.1] Uncomment Enterprise#relate_to_owners_enterprises
This commit is contained in:
Luis Ramos
2020-03-12 17:18:47 +00:00
committed by GitHub

View File

@@ -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