Displaying 1 result from an estimated 1 matches for "object_value_type".
2007 Apr 14
0
has_one with reference to the one stored in this object's table?
...t null auto_increment primary key
type varchar(255)
table generic_fields:
id int(11) not null auto_increment primary key
generic_object_id int(11) not null <-- points to its
owner
name varchar(255) not null
string_value varchar(255)
object_value_id int(11)
object_value_type varchar(255)
class GenericObject < ActiveRecord::Base
has_many :generic_fields, :dependent => :destroy
end
class GenericField < ActiveRecord::Base
belongs_to :generic_object
end
I then have some more magic code in GenericObject so that subclasses
can do things like this:...