Bug Fix:Fix development.rb to Correctly Detect Rails command (#12191)

* Bug Fix:Fix development.rb to Correctly Detect Rails command

* add DBConsole to dus check
This commit is contained in:
Molly Struve 2021-01-11 08:49:20 -06:00 committed by GitHub
parent 2eed22992c
commit 23ef8b7580
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,7 +128,7 @@ Rails.application.configure do
Bullet.add_whitelist(type: :n_plus_one_query, class_name: "User", association: :profile)
# Check if there are any data update scripts to run during startup
if %w[c console runner s server].include?(ENV["COMMAND"]) && DataUpdateScript.scripts_to_run?
if %w[Console Server DBConsole].any? { |const| Rails.const_defined?(const) } && DataUpdateScript.scripts_to_run?
message = "Data update scripts need to be run before you can start the application. " \
"Please run 'rails data_updates:run'"
raise message