enviornment-based enablement of zeitwerk
closes FOO-2440 flag=none TEST PLAN: 1) specs pass Change-Id: I10afd058843a42ce7a89d1a99fca63029c07c09e Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277154 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Jacob Burroughs <jburroughs@instructure.com> QA-Review: Ethan Vizitei <evizitei@instructure.com> Product-Review: Ethan Vizitei <evizitei@instructure.com>
This commit is contained in:
parent
78d83a8efb
commit
a6679f0fba
|
@ -43,7 +43,16 @@ Bundler.require(*Rails.groups)
|
|||
# ...
|
||||
# CANVAS_ZEITWERK: 1
|
||||
unless defined?(CANVAS_ZEITWERK)
|
||||
CANVAS_ZEITWERK = (ENV['CANVAS_ZEITWERK'] == '1')
|
||||
CANVAS_ZEITWERK = if ENV['CANVAS_ZEITWERK']
|
||||
(ENV['CANVAS_ZEITWERK'] == '1')
|
||||
elsif Rails.root && (zw_settings = ConfigFile.load("zeitwerk"))
|
||||
zw_settings["enabled"]
|
||||
else
|
||||
# choose to force zeitwerk on in dev/test
|
||||
# environments unless they override with
|
||||
# an env var or file
|
||||
!Rails.env.production?
|
||||
end
|
||||
end
|
||||
|
||||
module CanvasRails
|
||||
|
|
Loading…
Reference in New Issue