Double join with habtm in ActiveRecord
- by Daniel Huckstep
I have a weird situation involving the need of a double inner join. I have tried the query I need, I just don't know how to make rails do it.
The Data
Account (has_many :sites)
Site (habtm :users, belongs_to :account)
User (habtm :sites)
Ignore that they are habtm or whatever, I can make them habtm or has_many :through.
I want to be able to…