It is my understanding that when defining a :counter\_cache option it is to be specified on the model that includes the belongs\_to declaration. So I am a little unsure of how to handle this when working with a has\_may through association (as I believe that a belongs\_to declaration is not used in this scenario):

```
class Physician < ActiveRecord::Base
  has_many :appointments
  has_many :patients, :through => :appointments
end

class Appointment < ActiveRecord::Base
  belongs_to :physician, :counter_cache => appointment_count
end

class Patient < ActiveRecord::Base
end

```

I wish to use the :counter\_cache option to make finding the number of Patients belonging to a Physician more efficient.

```
myPhysician.patients.count

```

FYI: Rails 3.1

Cheers