Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AO3-6611 Prevent autoloading in initialization #4634

Merged
merged 7 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/initializers/archive_config/locale.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion config/initializers/archive_config/settings_for_admin.rb
Original file line number Diff line number Diff line change
@@ -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?
Expand Down
5 changes: 3 additions & 2 deletions config/initializers/monkeypatches/mailers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion factories/challenges.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)] }
Expand Down
3 changes: 1 addition & 2 deletions factories/user_invite_requests.rb
Original file line number Diff line number Diff line change
@@ -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!" }
Expand Down
Loading