rails/rails — pull request #13107 by chancancode (2013-11-30 04:04:00+00:00)
Title: Raise `ArgumentError` when `has_one` is used with `counter_cache`

I came across this when working on an app that has something like this:

```ruby
class University < AR::Base
has_many :researchers
has_many :publications, through: :researchers
end

class Researchers < AR::Base
belongs_to :university
has_many :publications
end

class Publication < AR::Base
belongs_to :researcher
has_one :university, through: :researchers, counter_cache: true
end
```

Of course it wasn't working, and that I later realized that this is not supposed to work at all, and I was wondering why it didn't raise an error. After some digging, it seems like this is a bug that was introduced in 52f8e4b9.

cc @senny, @jonleighton