Select from multiple tables in Rails - Has Many "articles" through [table_1, table_2]?
- by viatropos
I'm in a situation where I need to get all articles that are tied to a User through 2 tables:
article_access: gives users privilege to see an article
article_favorites: of public articles, users have favorited these
So in ActiveRecord you might have this:
class User < ActiveRecord::Base
has_many :article_access_tokens
has_many…