From a39c958e8bd1b97d20854267e0f7d0c254c182ba Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Tue, 16 Jan 2024 11:41:29 -0600 Subject: [PATCH] Update order of install generator --- lib/generators/spotlight/install_generator.rb | 18 +++++++----------- .../config/initializers/translation.rb | 6 ++++-- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/lib/generators/spotlight/install_generator.rb b/lib/generators/spotlight/install_generator.rb index fa23ef0614..7f79134fd7 100644 --- a/lib/generators/spotlight/install_generator.rb +++ b/lib/generators/spotlight/install_generator.rb @@ -152,15 +152,6 @@ def add_mailer_defaults end end - def generate_config - directory 'config' - end - - def add_solr_config_resources - copy_file '.solr_wrapper.yml', '.solr_wrapper.yml' - directory 'solr' - end - def generate_devise_invitable gem 'devise_invitable' bundle_install @@ -168,8 +159,13 @@ def generate_devise_invitable generate 'devise_invitable', 'User' end - def add_translations - copy_file 'config/initializers/translation.rb' + def generate_config + directory 'config' + end + + def add_solr_config_resources + copy_file '.solr_wrapper.yml', '.solr_wrapper.yml' + directory 'solr' end def configure_logging diff --git a/lib/generators/spotlight/templates/config/initializers/translation.rb b/lib/generators/spotlight/templates/config/initializers/translation.rb index 0cc4a6680c..93a691d0a3 100644 --- a/lib/generators/spotlight/templates/config/initializers/translation.rb +++ b/lib/generators/spotlight/templates/config/initializers/translation.rb @@ -7,8 +7,10 @@ # Don't allow initializer to break if DB doesn't exist yet # see: https://github.com/projectblacklight/spotlight/issues/2133 if ENV['SKIP_TRANSLATION'].blank? - raise unless Translation.table_exists? - + unless Translation.table_exists? + warn "Translation table doesn't exist. Skipping translation config." + next + end ## # Sets up the new Spotlight Translation backend, backed by ActiveRecord. To # turn on the ActiveRecord backend, uncomment the following lines.