lib/generators/spotlight/templates/config/initializers/translation.rb in blacklight-spotlight-3.6.0.beta7 vs lib/generators/spotlight/templates/config/initializers/translation.rb in blacklight-spotlight-3.6.0.beta8
- old
+ new
@@ -5,11 +5,13 @@
ActiveSupport::Reloader.to_prepare do
# 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.
I18n.backend = I18n::Backend::ActiveRecord.new
I18n::Backend::ActiveRecord.include I18n::Backend::Memoize