Merge pull request #51452 from Shopify/update-inverse-of-nil

Suggest `inverse_of: nil` instead of `false`
This commit is contained in:
Jean Boussier 2024-03-30 10:08:38 +01:00 committed by GitHub
commit f9c262be8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

@ -715,7 +715,7 @@ def automatic_inverse_of
" 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

@ -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
```