mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
Insert middleware in production mode if enabled
This commit is contained in:
@ -17,14 +17,12 @@ class Plugin::Theme
|
||||
def register_public
|
||||
public_dir = "#{@plugin.directory}/public"
|
||||
if File.exist?(public_dir)
|
||||
if Rails.env.development?
|
||||
Rails.application.config.before_initialize do |app|
|
||||
app.middleware.insert_before(
|
||||
::ActionDispatch::Static,
|
||||
::ActionDispatch::Static,
|
||||
public_dir
|
||||
)
|
||||
end
|
||||
Rails.application.config.before_initialize do |app|
|
||||
app.middleware.insert_before(
|
||||
::ActionDispatch::Static,
|
||||
::ActionDispatch::Static,
|
||||
public_dir
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user