From c716815961acde41c1d1dbd2a7c362504e23db62 Mon Sep 17 00:00:00 2001 From: Jason Frey Date: Thu, 4 Nov 2021 15:31:04 -0400 Subject: [PATCH] Temporary override of the belongs_to_required_by_default setting Temporary override of the belongs_to_required_by_default settomgs until we can change the migrations specs to honor it --- .../automated_review/belongs_to_required_by_default_spec.rb | 6 ++++++ spec/dummy/config/application.rb | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 spec/automated_review/belongs_to_required_by_default_spec.rb diff --git a/spec/automated_review/belongs_to_required_by_default_spec.rb b/spec/automated_review/belongs_to_required_by_default_spec.rb new file mode 100644 index 000000000..02e0822c9 --- /dev/null +++ b/spec/automated_review/belongs_to_required_by_default_spec.rb @@ -0,0 +1,6 @@ +describe "belongs_to_required_by_default" do + it "should be the default value of true", :skip => "Skipped until all migrations specs are changed to work with the default value" do + # NOTE: Once all migrations are changed, we can remove this test. It is here to act as a reminder. + expect(Rails.application.config.active_record.belongs_to_required_by_default).to be true + end +end diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index f86e8ee0f..4255e773e 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -15,5 +15,9 @@ class Application < Rails::Application # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. + + # HACK: Temporary override of the default setting until we can update the + # migration specs to honor it. + config.active_record.belongs_to_required_by_default = false end end