What you pass to :joins must exactly match the name of the association
(the first argument to has_many, belongs_to etc...).
So if you have has_many :accounts then you need :joins => :accounts or
else you will get that error message (which is normal: you don't have
an association named account only one named accounts).