Rails auto-generated a join table in this relationship :
# User.rb
has_and_belongs_to :topics
# Topic.rb
has_and_belongs_to :users
I want to query the join table, topics_users directly for a to obtain an ID’s.
This strategy I feel would be the fastest at getting the User ID’s from the Topics, rather than looking up the Join Table, looking up the Users, and Getting the ID’s from the users.
If you really want to you can execute manual sql queries as follows: