1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-02-06 09:03:25 +00:00

Fix assets are not compiled on startup in production mode with Propshaft 1.3.0 (#43396).

Patch by Takashi Kato (user:tohosaku) and Takenori TAKAKI (user:takenory).


git-svn-id: https://svn.redmine.org/redmine/trunk@24132 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2025-11-06 23:51:29 +00:00
parent 2bf7316af7
commit a25321e1e7
2 changed files with 9 additions and 5 deletions

View File

@ -120,11 +120,8 @@ Mime::SET << 'api'
module Propshaft
Assembly.prepend(Module.new do
def initialize(config)
super
if Rails.application.config.assets.redmine_detect_update && (!config.manifest_path.exist? || manifest_outdated?)
processor.process
end
def needs_precompile?
!config.manifest_path.exist? || manifest_outdated?
end
def manifest_outdated?

View File

@ -116,4 +116,11 @@ Rails.application.config.to_prepare do
end
end
# Automatically execute asset precompilation on startup in case of changes have been detected in assets
Rails.application.config.after_initialize do |app|
if app.config.assets.redmine_detect_update && app.assets.needs_precompile?
app.assets.processor.process
end
end
Rails.application.deprecators[:redmine] = ActiveSupport::Deprecation.new('7.0', 'Redmine')