-
-
Notifications
You must be signed in to change notification settings - Fork 198
Closed
Description
While upgrading Rails, at one time, we didn't change to all the new default behaviors, but we auto-enabled the old behavior, postponing some work. This Issue is about such a chore.
Step 1: disable this "automatic optional" setting in config/application.rb
# TODO: sort this out properly at
# See https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#active-record-belongs-to-required-by-default-option
config.active_record.belongs_to_required_by_default = false
Step 2: in each model's belongs_to associations, decide whether that is an optional relationship or not. Where it is optional, add the keyword argument optional: true
.
Step 3: pass all tests, and you are done!
Metadata
Metadata
Assignees
Labels
No labels