Please sign in to comment.
Raise `ArgumentError` when `has_one` is used with `counter_cache`
Previously, the `has_one` macro incorrectly accepts the `counter_cache` option due to a bug, although that options was never supported nor functional on `has_one` and `has_one ... through` relationships. It now correctly raises an `ArgumentError` when passed that option. For reference, this bug was introduced in 52f8e4b.
- Loading branch information...
Showing with 25 additions and 2 deletions.
- +7 −0 activerecord/CHANGELOG.md
- +1 −1 activerecord/lib/active_record/associations/builder/belongs_to.rb
- +1 −1 activerecord/lib/active_record/associations/builder/singular_association.rb
- +8 −0 activerecord/test/cases/associations/has_one_associations_test.rb
- +8 −0 activerecord/test/cases/associations/has_one_through_associations_test.rb