diff --git a/app/controllers/admin/subscription_line_items_controller.rb b/app/controllers/admin/subscription_line_items_controller.rb index 5011129c5f6..d981b71fe1f 100644 --- a/app/controllers/admin/subscription_line_items_controller.rb +++ b/app/controllers/admin/subscription_line_items_controller.rb @@ -1,5 +1,6 @@ require 'open_food_network/permissions' require 'open_food_network/order_cycle_permissions' +require 'open_food_network/scope_variant_to_hub' module Admin class SubscriptionLineItemsController < ResourceController diff --git a/app/controllers/spree/admin/line_items_controller_decorator.rb b/app/controllers/spree/admin/line_items_controller_decorator.rb index 7210a6abb10..3ef85234df4 100644 --- a/app/controllers/spree/admin/line_items_controller_decorator.rb +++ b/app/controllers/spree/admin/line_items_controller_decorator.rb @@ -1,3 +1,5 @@ +require 'open_food_network/scope_variant_to_hub' + Spree::Admin::LineItemsController.class_eval do prepend_before_filter :load_order, except: :index around_filter :apply_enterprise_fees_with_lock, only: :update diff --git a/app/models/order_cycle.rb b/app/models/order_cycle.rb index 4d8f443a681..7948d1ed434 100644 --- a/app/models/order_cycle.rb +++ b/app/models/order_cycle.rb @@ -1,3 +1,5 @@ +require 'open_food_network/scope_variant_to_hub' + class OrderCycle < ActiveRecord::Base belongs_to :coordinator, :class_name => 'Enterprise' diff --git a/app/models/spree/inventory_unit_decorator.rb b/app/models/spree/inventory_unit_decorator.rb index 9868596b41f..f3f5481a619 100644 --- a/app/models/spree/inventory_unit_decorator.rb +++ b/app/models/spree/inventory_unit_decorator.rb @@ -1,3 +1,5 @@ +require 'open_food_network/scope_variant_to_hub' + module Spree InventoryUnit.class_eval do def self.assign_opening_inventory(order) diff --git a/app/models/spree/line_item_decorator.rb b/app/models/spree/line_item_decorator.rb index 6f74e195304..acc4e308b68 100644 --- a/app/models/spree/line_item_decorator.rb +++ b/app/models/spree/line_item_decorator.rb @@ -1,3 +1,4 @@ +require 'open_food_network/scope_variant_to_hub' require 'open_food_network/variant_and_line_item_naming' Spree::LineItem.class_eval do diff --git a/app/services/order_factory.rb b/app/services/order_factory.rb index fdef7b6b667..68e7224158b 100644 --- a/app/services/order_factory.rb +++ b/app/services/order_factory.rb @@ -1,3 +1,5 @@ +require 'open_food_network/scope_variant_to_hub' + # Builds orders based on a set of attributes # There are some idiosyncracies in the order creation process, # and it is nice to have them dealt with in one place. diff --git a/app/services/subscription_estimator.rb b/app/services/subscription_estimator.rb index 5abe3880292..8e69e310ac9 100644 --- a/app/services/subscription_estimator.rb +++ b/app/services/subscription_estimator.rb @@ -1,3 +1,5 @@ +require 'open_food_network/scope_variant_to_hub' + # Responsible for estimating prices and fees for subscriptions # Used by SubscriptionForm as part of the create/update process # The values calculated here are intended to be persisted in the db diff --git a/app/views/spree/admin/payments/_form.html.erb b/app/views/spree/admin/payments/_form.html.erb index e46b2febcda..e075d1288a7 100644 --- a/app/views/spree/admin/payments/_form.html.erb +++ b/app/views/spree/admin/payments/_form.html.erb @@ -1,5 +1,5 @@ <%= admin_inject_json "admin.payments", "currentOrderNumber", @order.number %> -<%= admin_inject_json_ams_array "admin.payments", "paymentMethods", @payment_methods, Api::PaymentMethodSerializer %> +<%= admin_inject_json_ams_array "admin.payments", "paymentMethods", @payment_methods, Api::PaymentMethodSerializer, current_order: @order %>