Prepend custom assets to CONSUL assets

Rails 5 changed the initialization order, and now our initializers were
running before the `append_assets_path` initializer for each engine,
which prepended application assets to the custom assets we prepended in
the initializer.

Moving the code to the `config.after_initialize` code didn't work
either, since the paths added there were ignored by the application.

Adding another initializer to the Rails Engine is a hack, but solves the
problem.
This commit is contained in:
Javi Martín
2019-04-16 17:05:04 +02:00
committed by Julian Herrero
parent 58b9899406
commit 4adf712c26
2 changed files with 10 additions and 5 deletions

View File

@@ -16,8 +16,3 @@ Rails.application.config.assets.precompile += %w( print.css )
Rails.application.config.assets.precompile += %w( ie.css )
# Loads custom images and custom fonts before app/assets/images and app/assets/fonts
assets_path = Rails.application.config.assets.paths
%w[images fonts javascripts].each do |asset|
assets_path.insert(0, Rails.root.join("app", "assets", asset, "custom").to_s)
end