correct environment handling for test mode

This commit is contained in:
Sam 2017-04-14 14:00:46 -04:00
parent 873a07a625
commit ed2e62f845

View File

@ -250,9 +250,9 @@ class ApplicationController < ActionController::Base
def resolve_safe_mode
safe_mode = params[SAFE_MODE]
if safe_mode
request.env[NO_CUSTOM] = true if safe_mode.include?(NO_CUSTOM)
request.env[NO_PLUGINS] = true if safe_mode.include?(NO_PLUGINS)
request.env[ONLY_OFFICIAL] = true if safe_mode.include?(ONLY_OFFICIAL)
request.env[NO_CUSTOM] = !!safe_mode.include?(NO_CUSTOM)
request.env[NO_PLUGINS] = !!safe_mode.include?(NO_PLUGINS)
request.env[ONLY_OFFICIAL] = !!safe_mode.include?(ONLY_OFFICIAL)
end
end