mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 23:19:25 +08:00
Insert middleware in production mode if enabled
This commit is contained in:
parent
8d4cff642e
commit
fffa285dbf
@ -263,11 +263,6 @@ class Plugin::Instance
|
||||
themes << theme
|
||||
end
|
||||
|
||||
# def register_public
|
||||
# return unless enabled?
|
||||
#
|
||||
# end
|
||||
|
||||
def automatic_assets
|
||||
css = styles.join("\n")
|
||||
js = javascripts.join("\n")
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user