From a9eb19ffa6b8e92eb084985058fcb836e7702a87 Mon Sep 17 00:00:00 2001 From: Ryan Shaw Date: Mon, 9 Oct 2017 09:48:23 -0600 Subject: [PATCH] =?UTF-8?q?make=20compile=5Fassets=20work=20when=20there?= =?UTF-8?q?=E2=80=99s=20no=20db.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: CNVS-39854 Test plan: * mv config/database.yml config/database.yml.backup * bundle exec rake canvas:compile_assets * it should work * Docker build should pass Change-Id: I0786d1de1d6f6f69d665e10b0428571e77d7f859 Reviewed-on: https://gerrit.instructure.com/128974 Reviewed-by: James Williams Reviewed-by: Cody Cutrer Tested-by: Jenkins Product-Review: Ryan Shaw QA-Review: Ryan Shaw --- config/initializers/revved_asset_urls.rb | 6 +++++- lib/tasks/css.rake | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/config/initializers/revved_asset_urls.rb b/config/initializers/revved_asset_urls.rb index ce65450570a..27ae8ed1a6c 100644 --- a/config/initializers/revved_asset_urls.rb +++ b/config/initializers/revved_asset_urls.rb @@ -19,7 +19,11 @@ # instead of doing it's normal cache busting stuff on the url. # eg: instead of '/images/whatever.png?12345', we want '/dist/images/whatever-.png'. # There is a different method that needs to be monkeypatched for rails 3 vs rails 4 -require 'action_view/helpers/asset_url_helper' + + + +require 'action_view/helpers' + module RevAssetPaths def path_to_asset(source, options = {}) original_path = super diff --git a/lib/tasks/css.rake b/lib/tasks/css.rake index 8e781c67b45..8d73b45f801 100644 --- a/lib/tasks/css.rake +++ b/lib/tasks/css.rake @@ -9,6 +9,7 @@ namespace :css do task :compile do # try to get a conection to the database so we can do the brand_configs:write below require 'config/environment' rescue nil + require 'config/initializers/revved_asset_urls' require 'lib/brandable_css' puts "--> Starting: 'css:compile'" time = Benchmark.realtime do