File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -102,9 +102,14 @@ def preload
102
102
103
103
Rails ::Application . initializer :ensure_reloading_is_enabled , group : :all do
104
104
if Rails . application . config . cache_classes
105
+ config_name , set_to = if Rails . application . config . respond_to? ( :enable_reloading= )
106
+ [ "enable_reloading" , "true" ]
107
+ else
108
+ [ "cache_classes" , "false" ]
109
+ end
105
110
raise <<-MSG . strip_heredoc
106
111
Spring reloads, and therefore needs the application to have reloading enabled.
107
- Please, set config.cache_classes to false in config/environments/#{ Rails . env } .rb.
112
+ Please, set config.#{ config_name } to #{ set_to } in config/environments/#{ Rails . env } .rb.
108
113
MSG
109
114
end
110
115
end
Original file line number Diff line number Diff line change @@ -144,7 +144,12 @@ def without_gem(name)
144
144
end
145
145
File . write ( config_path , config )
146
146
147
- assert_failure "bin/rails runner 1" , stderr : "Please, set config.cache_classes to false"
147
+ expected_error = Regexp . union (
148
+ "Please, set config.enable_reloading to true" ,
149
+ "Please, set config.cache_classes to false"
150
+ )
151
+
152
+ assert_failure "bin/rails runner 1" , stderr : expected_error
148
153
end
149
154
150
155
test "test changes are picked up" do
You can’t perform that action at this time.
0 commit comments