On 18 Sep 2008, at 09:26, Jose G. wrote:
> 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 :
>
> .
> .
> t.Template2 :description, # 'Template2' includes ":default => "short  
> Description",  :limit => 20"
> t.Template3 :longdescription, # 'Template3' includes ":default =>  
> "long Description",  :limit => 40"
> .
> .
>
> 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.

Fred
> Thanks,
>
> Jose.
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to