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
I added a counter_cache to a has_many :through association on Rails 5.1, and the philosophy is the same as with has_many. Using the Physician, Appointment, Patient example:
patients_count to the physicians table as an integerbelongs_to :physician, counter_cache: :patients_countNote: the answer above is correct, this answer just confirms that it works on Rails 5.1.