Displaying 1 result from an estimated 1 matches for "favorable_type".
2006 Jul 10
2
Polymorphic associations in reverse?
...able, :through => :favorites,
:classname => "User"
end
class Favorite < ActiveRecord::Base
belongs_to :favorable, :polymorphic => true
end
create_table "favorites" do |t|
t.column :user_id, :integer
t.column :favorable_id, :integer
t.column :favorable_type, :string
end
create_table "images" do |t|
t.column :name, :string
end
create_table "users" do |t|
t.column :name, :string
end
###############################################################
This is of course wrong and does not work :) But I don''t know
whethe...