diff --git a/config/initializers/archive_config/locale.rb b/config/initializers/archive_config/locale.rb index f06f39668a8..8508c0ed573 100644 --- a/config/initializers/archive_config/locale.rb +++ b/config/initializers/archive_config/locale.rb @@ -1,4 +1,4 @@ -begin +Rails.application.config.after_initialize do ActiveRecord::Base.connection # try to set language and locale using models (which use Archive Config) Language.default @@ -10,7 +10,7 @@ rescue # ArchiveConfig didn't work, try to set it manually if Language.table_exists? && Locale.table_exists? - language = Language.find_or_create_by(short: 'en', name: 'English') + language = Language.find_or_create_by(short: "en", name: "English") Locale.set_base_locale(iso: "en", name: "English (US)", language_id: language.id) end end diff --git a/config/initializers/archive_config/settings_for_admin.rb b/config/initializers/archive_config/settings_for_admin.rb index a45368a9a41..f5f9e29451a 100644 --- a/config/initializers/archive_config/settings_for_admin.rb +++ b/config/initializers/archive_config/settings_for_admin.rb @@ -1,4 +1,4 @@ -begin +Rails.application.config.after_initialize do # If we have no database, fall through to rescue ActiveRecord::Base.connection AdminSetting.default if AdminSetting.table_exists? diff --git a/config/initializers/monkeypatches/mailers_controller.rb b/config/initializers/monkeypatches/mailers_controller.rb index bed94e324b4..ca8f9417899 100644 --- a/config/initializers/monkeypatches/mailers_controller.rb +++ b/config/initializers/monkeypatches/mailers_controller.rb @@ -6,5 +6,6 @@ module MailersController skip_rack_dev_mark end end - -::Rails::MailersController.include MailersController +Rails.application.config.after_initialize do + ::Rails::MailersController.include MailersController +end diff --git a/factories/challenges.rb b/factories/challenges.rb index abfed0a2f26..0372abda42c 100644 --- a/factories/challenges.rb +++ b/factories/challenges.rb @@ -16,7 +16,7 @@ offers_attributes { [attributes_for(:offer)] } end - factory :prompt_meme_signup, class: ChallengeSignup do + factory :prompt_meme_signup, class: "ChallengeSignup" do pseud { create(:user).default_pseud } collection { create(:collection, challenge: create(:prompt_meme)) } requests_attributes { [attributes_for(:request)] } diff --git a/factories/user_invite_requests.rb b/factories/user_invite_requests.rb index 7c29e87c715..7572faf44dd 100644 --- a/factories/user_invite_requests.rb +++ b/factories/user_invite_requests.rb @@ -1,7 +1,6 @@ require 'faker' FactoryBot.define do - - factory :user_invite_requests, class: UserInviteRequest do + factory :user_invite_requests, class: "UserInviteRequest" do user_id { FactoryBot.create(:user).id } quantity { 5 } reason { "Because reasons!" }