Displaying 1 result from an estimated 1 matches for "favorite_profiles".
2006 Jun 23
2
polymorphic challenge
...e :relations do |t|
t.column :user_id, :integer
t.column :relationable_type, :string
t.column :relationable_id, :string
t.column :created_at, :datetime
end
class Relation < ActiveRecord::Base
belongs_to :relationable, :polymorphic => true
end
class User
has_many :favorite_profiles, :as => :relationable, :class_name =>
"Relation"
has_many :favorites, :class_name => "User",
:through => :favorite_profiles
end
And nope Rails just does not like my wise plan by saying
"ActiveRecord::HasManyThroughSourceAssociationNotFoundError:...