Skip to content

Commit d6ec8db

Browse files
committed
Suggest inverse_of: nil instead of false
Followup: rails#50883 Ref: rails#50284 (comment)
1 parent a2a870a commit d6ec8db

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

activerecord/lib/active_record/reflection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ def automatic_inverse_of
715715
" is disabled.\n\n" \
716716
"If automatic inference is intended, you can consider enabling" \
717717
" `config.active_record.automatically_invert_plural_associations`.\n\n" \
718-
"If automatic inference is not intended, you can silence this warning by defining the association with `inverse_of: false`."
718+
"If automatic inference is not intended, you can silence this warning by defining the association with `inverse_of: nil`."
719719
)
720720
reflection = nil
721721
end

guides/source/configuring.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ And on a per-association basis:
10901090
class Comment < ApplicationRecord
10911091
self.automatically_invert_plural_associations = true
10921092
1093-
belongs_to :post, inverse_of: false
1093+
belongs_to :post, inverse_of: nil
10941094
end
10951095
```
10961096

0 commit comments

Comments
 (0)