From e584233c9e07d39504bfcc28e0de5feae93bdd7e Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Tue, 3 Mar 2020 14:25:17 +0000 Subject: [PATCH] Uncomment code that was commented earlier on in the upgrade, we are now ready to handle this --- app/models/enterprise.rb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 52b5ccac4e..887b1deccd 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -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