Consider this:
class User < ActiveRecord::Base
# name, email, password
end
class Article < ActiveRecord::Base
# user_id, title, text
end
class Favorites < ActiveRecord::Base
# user_id, article_id
end
How do I put this all together in a way that I can have @user.articles (articles created by the user) and @user.favorite_articles (favorite articles from Favorite model)
Thanks in advance!