has_many :through + polymorphic relationships
I using rails3 and trying to build some complex associations. I have Product, Version and Property models. class Version < ActiveRecord::Base belongs_to :product has_many :specs has_many :properties, :through => :specs end class Product < ActiveRecord::Base has_many :versions has_many :specs has_many :properties, :through => :specs end class Property < ActiveRecord::Base end class Spec < ActiveRecord::Base belongs_to :product belongs_to :spec belongs_to :version end It works perfect, but i want to use product and version as polymorphic relations, so table specs will have only spec_id and some