Suggest `inverse_of: nil` instead of `false`

Followup: https://github.com/rails/rails/pull/50883
Ref: https://github.com/rails/rails/pull/50284#issuecomment-2027722175
This commit is contained in:
Jean Boussier 2024-03-30 09:53:38 +01:00
parent a2a870a736
commit d6ec8dbc48
2 changed files with 2 additions and 2 deletions

View File

@ -715,7 +715,7 @@ module ActiveRecord
" is disabled.\n\n" \
"If automatic inference is intended, you can consider enabling" \
" `config.active_record.automatically_invert_plural_associations`.\n\n" \
"If automatic inference is not intended, you can silence this warning by defining the association with `inverse_of: false`."
"If automatic inference is not intended, you can silence this warning by defining the association with `inverse_of: nil`."
)
reflection = nil
end

View File

@ -1090,7 +1090,7 @@ And on a per-association basis:
class Comment < ApplicationRecord
self.automatically_invert_plural_associations = true
belongs_to :post, inverse_of: false
belongs_to :post, inverse_of: nil
end
```