From da918ac43e143f4cf02ad25a06681757efddfa98 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 4 Sep 2020 15:23:01 -0400 Subject: [PATCH] FIX: Allow us to call `script_asset_url` in controllers Without this patch fingerprinting was not applied in production. --- app/controllers/bootstrap_controller.rb | 1 - app/helpers/application_helper.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/bootstrap_controller.rb b/app/controllers/bootstrap_controller.rb index e9e0e82c3bb..146e89266d9 100644 --- a/app/controllers/bootstrap_controller.rb +++ b/app/controllers/bootstrap_controller.rb @@ -2,7 +2,6 @@ class BootstrapController < ApplicationController include ApplicationHelper - include ActionView::Helpers::AssetUrlHelper # This endpoint allows us to produce the data required to start up Discourse via JSON API, # so that you don't have to scrape the HTML for `data-*` payloads diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c0dec694b17..4970b7dbd50 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -55,7 +55,7 @@ module ApplicationHelper end def script_asset_path(script) - path = asset_path("#{script}.js") + path = ActionController::Base.helpers.asset_path("#{script}.js") if GlobalSetting.use_s3? && GlobalSetting.s3_cdn_url if GlobalSetting.cdn_url