Displaying 1 result from an estimated 1 matches for "illustrated_type".
2006 Apr 28
2
file_column with polymorphic table relationship?
...g trouble determining how to reference the file_column
field in the images table from an associated view.
As an example, here''s a condensed version of the relationships:
create_table :images do |t|
t.column :file, :string
t.column :illustrated_id, :integer
t.column :illustrated_type, :string
end
create_table :thing do |table|
table.column :name, :string
table.column :description, :string
end
...and models:
class Thing < ActiveRecord::Base
has_one :image, :as => :illustrated
end
class Image < ActiveRecord::Base
belongs_to :illustrated, :...