Displaying 1 result from an estimated 1 matches for "booleanfield".
Did you mean:
boolean_field
2006 Aug 15
0
ActiveRecord inheritance with types table
...table:
fields:
id
field_type_id
name
ordering
every field has a type
class FieldType < ActiveRecord::Base
end
stored in the field_types table
field_types:
id
name
class_name
for each field type, there''s a subclass of Field that do whatever
special things
class BooleanField < Field
def get_stuff
return "I am a Boolen Field!"
end
end
Is there any way, when I do Field.find(), that I can return fields that
are all instances of the proper Field subclasses?
I know this could be done using single table inheritance, but I like to
have the cla...