Displaying 1 result from an estimated 1 matches for "attr_integer".
2006 Jul 25
1
Node Attributes
...ally. Or what i can do is put all the Attributes in one
model, with a column in the database for every kind of type:
create_table :attributes do |t|
t.column :name, :string
t.column :type, :string
t.column :attr_string, :string
t.column :attr_text, :text
t.column :attr_integer, :integer
.
.
.
t.column :attr_boolean, :boolean
end
so to access the attribute would be through a function that does a
switch against the type.
now, which way would be better? the polymorphic way, or the single table
way?
--
Posted via http://www.ruby-forum.com/.