A 'user has many posts and a product has many posts, and any given post can belong to either a user or a product but not both.
I think a has_many :through relationship stored in a posts_relationships table and written like:
Class User < ActiveRecord::Base
has_many :posts, :through => posts_relationships
and
Class Product < ActiveRecord::Base
has_many :posts, :through => posts_relationships
would express what I need. Is that the correct and simplest way to do it? It’s not a complex relationship so I want to write it as simply as possible.
consider polymorphic association.