WIP - Update loading of helpers in controllers

Rails has changed the way helpers are loaded. It's a bit weird. It was throwing lots of errors, and recommended using this setting, but now requires that all helpers are loaded explicitly. I'm not sure about this.
This commit is contained in:
Matt-Yorkley
2021-03-04 13:22:27 +00:00
committed by Andy Brett
parent 97b696a1c5
commit 3070bb20ed
5 changed files with 20 additions and 2 deletions

View File

@@ -13,6 +13,18 @@ class ApplicationController < ActionController::Base
self.responder = ApplicationResponder
respond_to :html
helper 'spree/base'
helper 'spree/orders'
helper 'shared'
helper 'enterprises'
helper 'order_cycles'
helper 'order'
helper 'shop'
helper 'injection'
helper 'markdown'
helper 'footer_links'
helper 'discourse'
protect_from_forgery
include Spree::Core::ControllerHelpers::Auth

View File

@@ -13,8 +13,6 @@ class BaseController < ApplicationController
include I18nHelper
include OrderCyclesHelper
helper 'spree/base'
before_action :set_locale
before_action :check_order_cycle_expiry

View File

@@ -3,7 +3,12 @@ module Spree
class BaseController < ApplicationController
ssl_required
helper 'shared'
helper 'spree/admin/navigation'
helper 'spree/admin/orders'
helper 'admin/injection'
helper 'admin/orders'
layout '/spree/layouts/admin'
include I18nHelper

View File

@@ -200,5 +200,7 @@ module Openfoodnetwork
config.active_support.escape_html_entities_in_json = true
config.active_job.queue_adapter = :delayed_job
config.action_controller.include_all_helpers = false
end
end

View File

@@ -4,6 +4,7 @@ require "spec_helper"
describe "spree/admin/shared/_order_links.html.haml" do
helper Spree::BaseHelper # required to make pretty_time work
helper Spree::Admin::OrdersHelper
before do
order = create(:order)