12314 - fix Rails/HelperInstanceVariable error

- InjectionHelper
- OrdersHelper
This commit is contained in:
Ahmed Ejaz
2024-04-01 02:19:14 +05:00
parent ac1595e718
commit 4ba6afa665
2 changed files with 12 additions and 12 deletions

View File

@@ -154,7 +154,6 @@ module InjectionHelper
end
def enterprise_injection_data
@enterprise_injection_data ||= OpenFoodNetwork::EnterpriseInjectionData.new
{ data: @enterprise_injection_data }
@enterprise_injection_data ||= { data: OpenFoodNetwork::EnterpriseInjectionData.new }
end
end

View File

@@ -17,17 +17,18 @@ module Spree
def changeable_orders
# Only returns open order for the current user + shop + oc combo
return @changeable_orders unless @changeable_orders.nil?
return @changeable_orders = [] unless spree_current_user &&
current_distributor && current_order_cycle
return @changeable_orders = [] unless current_distributor.allow_order_changes?
@changeable_orders ||= if spree_current_user &&
current_distributor&.allow_order_changes? && current_order_cycle
@changeable_orders = Spree::Order.complete.where(
state: 'complete',
user_id: spree_current_user.id,
distributor_id: current_distributor.id,
order_cycle_id: current_order_cycle.id
)
Spree::Order.complete.where(
state: 'complete',
user_id: spree_current_user.id,
distributor_id: current_distributor.id,
order_cycle_id: current_order_cycle.id
)
else
[]
end
end
def changeable_orders_link_path