Project

General

Profile

« Previous | Next » 

Revision 40cfadc7

Added by Daniel Lobato Garcia over 8 years ago

Refs #11813 - Use new engines listing syntax in initializers

(cherry picked from commit 783efdcc293d9c4540b373fe8c5c48ffb11857de)

View differences:

config/environments/production.rb
# Adds plugin assets to the application digests hash if a manifest file exists for a plugin
config.after_initialize do
app.railties.engines.each do |engine|
::Rails::Engine.subclasses.map(&:instance).each do |engine|
[engine.root, app.root].each do |root_dir|
manifest_path = File.join(root_dir, "public/assets/#{engine.engine_name}/manifest.yml")
......
# Serve plugin static assets if the application is configured to do so
if config.serve_static_assets
app.railties.engines.each do |engine|
::Rails::Engine.subclasses.map(&:instance).each do |engine|
if File.exist?("#{engine.root}/public/assets")
app.middleware.use ::ActionDispatch::Static, "#{engine.root}/public"
end

Also available in: Unified diff