mushroom-observer icon indicating copy to clipboard operation
mushroom-observer copied to clipboard

config.active_record.belongs_to_required_by_default

Open JoeCohen opened this issue 1 year ago • 2 comments

config.active_record.belongs_to_required_by_default is a boolean value and controls whether a record fails validation if belongs_to association is not present. https://guides.rubyonrails.org/v6.1/configuring.html#configuring-active-record

This seems like a good thing to turn on, BUT it would currently blow up our tests (342 failures, 84 errors) at least because we often create model instances without all the associations.

Some options:

  • Turn it on only for production & development environments. Seems like an awful idea to have these differ from the test environment this way.
  • Turn it on and revise the tests to pass. Looks like a lot of work.
  • Permanently or temporarily leave things as-is.

JoeCohen avatar Jul 07 '22 13:07 JoeCohen