Reputation: 61
Postadmins.where(users: current_user)
This isn't going to work, but it shows what I'm looking for. A post admin has many users, but I'm looking for all postadmins that 'contains' or 'includes' at least the one particular user.
Upvotes: 0
Views: 61
Reputation: 4640
You should join users table, try this:
Postadmin.joins(:users).where(users: { id: current_user.id } )
Upvotes: 1