mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-20 07:21:12 +00:00
Add support for reloading plugin assets automatically in development mode (#31457).
Patch by Kouhei Sutou. git-svn-id: http://svn.redmine.org/redmine/trunk@18202 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
5f41a4320b
commit
069577c133
@ -20,12 +20,23 @@ if Object.const_defined?(:OpenIdAuthentication)
|
||||
end
|
||||
|
||||
Redmine::Plugin.load
|
||||
unless Redmine::Configuration['mirror_plugins_assets_on_startup'] == false
|
||||
|
||||
plugin_assets_dirs = {}
|
||||
Redmine::Plugin.all.each do |plugin|
|
||||
plugin_assets_dirs[plugin.assets_directory] = ["*"]
|
||||
end
|
||||
plugin_assets_reloader = ActiveSupport::FileUpdateChecker.new([], plugin_assets_dirs) do
|
||||
Redmine::Plugin.mirror_assets
|
||||
end
|
||||
Rails.application.reloaders << plugin_assets_reloader
|
||||
unless Redmine::Configuration['mirror_plugins_assets_on_startup'] == false
|
||||
plugin_assets_reloader.execute
|
||||
end
|
||||
|
||||
Rails.application.config.to_prepare do
|
||||
Redmine::FieldFormat::RecordList.subclasses.each do |klass|
|
||||
klass.instance.reset_target_class
|
||||
end
|
||||
|
||||
plugin_assets_reloader.execute_if_updated
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user