How can I create something like a "template" or "pattern" that includes for example ":default => "short Description", :limit => 20", then I only use this template to create the new table. Something like this :
How can I create something like a "template" or "pattern" that
includes for example ":default => "short Description", :limit =>
20", then I only use this template to create the new table.
Something like this :
Then I will use this new type to create new fields with the same
characteristics in all the tables.
Well you could certainly add methods to the TableDefinition class
(which is the class of the objects yielded by the create_table block)
if you wanted to.
> Neither. I was suggesting extending the TableDefinition
> (defined in
> schema_defintion.rb)
I wouldn't do that. This is ruby - you can reopen a class whenever you
feel like it, eg stick it in a file in lib and require that or (if
you're going to reuse it across apps) make it into a plugin.