Skip to content

Commit

Permalink
Merge pull request rails#51452 from Shopify/update-inverse-of-nil
Browse files Browse the repository at this point in the history
Suggest `inverse_of: nil` instead of `false`
  • Loading branch information
byroot authored Mar 30, 2024
2 parents a2a870a + d6ec8db commit f9c262b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/reflection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion guides/source/configuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down

0 comments on commit f9c262b

Please sign in to comment.