Convert ActiveRecord_Associations_CollectionProxy to array so that the modifications the tagRuleApplicator does on it will remain

Reject on ActiveRecord_Associations_CollectionProxy wont work
This commit is contained in:
Luis Ramos
2020-03-06 13:51:53 +00:00
parent 4ea891ee2f
commit 4b21aaafc4

View File

@@ -14,7 +14,7 @@ module EnterprisesHelper
def available_shipping_methods
return [] if current_distributor.blank?
shipping_methods = current_distributor.shipping_methods
shipping_methods = current_distributor.shipping_methods.to_a
applicator = OpenFoodNetwork::TagRuleApplicator.new(current_distributor, "FilterShippingMethods", current_customer.andand.tag_list)
applicator.filter!(shipping_methods)