mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-08 22:56:06 +00:00
12314 - fix Rails/HelperInstanceVariable error
- InjectionHelper - OrdersHelper
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user