building join queries and using the association name in the where method

I'm just learning how to build join queries in ActiveRecord, and I've noticed the following:

If I have     class Person < ActiveRecord::Base       has_many :meetings, class_name: 'Appointments'     end I can't do     Person.joins(:meetings).where({meetings: {status: 'cancelled'}}) I must do     Person.joins(:meetings).where({appointments: {status: 'cancelled'}})   (assuming the table underlying 'Appointment' is named 'appointments')

This strikes me as somewhat un-DRY-ish. Some questions I have: Am I correct that I can't use the association name in the condition? Has this been previously discussed? In particular has there been discussion about adding this (the ability to use the association name) to Rails? Anybody got any interesting workarounds to suggest? Any links to stuff (webpages/mailing-list-archive-entries/github issues) I should read?

Some questions I'm afraid to ask: What if my persons class has two relations that both refer to the Appointment class? What about Single Table Inheritance?

I've noticed that there is a "meta_where" gem (GitHub - activerecord-hackery/meta_where: ActiveRecord 3 query syntax on steroids. Not currently maintained.) that provided this for Rails 3.0, but it hasn't been updated for Rails 4, and its replacement/successor "squeel" doesn't seem to provide it.

P.S. This is a contrived example, which doesn't represent my app as a whole.