I'm trying to find a record by associated username which is included in a belongs_to relation, but it's not working.
Articles belong to Users Users have many articles
Article.where(user_id: someid)
works fine, but I'd like to use the username as reference which is stored in the Users table.
Article.includes(:user).where(:username => "erebus")
Article.includes(:user).where("user.username" => "erebus")
I also have identity_map_enabled: true
Article.includes(:user).inclusions
returns the relation details
Doesn't work, what am I not understanding?