mirror of
https://github.com/discourse/discourse.git
synced 2025-06-09 17:28:13 +08:00
DEV: Fix the enable_current_plugin
spec helper
Some plugins are always enabled and don’t have a related site setting. This patch takes this into account.
This commit is contained in:

committed by
Loïc Guitaut

parent
116a72504b
commit
c96e7aa723
@ -309,9 +309,9 @@ module Helpers
|
|||||||
end
|
end
|
||||||
|
|
||||||
def enable_current_plugin
|
def enable_current_plugin
|
||||||
setting_name =
|
plugin = Discourse.plugins_by_name[directory_from_caller.split("/").last]
|
||||||
Discourse.plugins_by_name[directory_from_caller.split("/").last].enabled_site_setting
|
return if plugin.enabled?
|
||||||
SiteSetting.public_send("#{setting_name}=", true)
|
SiteSetting.public_send("#{plugin.enabled_site_setting}=", true)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
Reference in New Issue
Block a user