Displaying 1 result from an estimated 1 matches for "genericfield".
Did you mean:
generic_fields
2007 Apr 14
0
has_one with reference to the one stored in this object's table?
...t_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:
class Person < GenericObject
field :first_name, String
field :last_name, String
field :spouse, Person
end
So far everythin...