This was my solution for a polymorphic many-to-many association
class ItemCountry < ActiveRecord::Base
belongs_to :locatable, :polymorphic => true
belongs_to :country
# fields are :locatable_id, :locatable_type, :country_id
end
class Title < ActiveRecord::Base
has_many :countries, :through => :item_countries, :as => :locatable