thx
2009/6/22 Philip Hallstrom <philip-LSG90OXdqQE@public.gmane.org>
>
> > I am a newb. I have one question about following code:
> >
> > def self.up
> > create_table :order_histories do |t|
> > t.column :order_id, :integer, :null => false
> > t.column :created_at, :timestamp
> > t.column :notes, :text
> > end
> > end
> >
> > so, create_table is a method which takes the name of table
> > (order_histories) and a code block. I wonder what''s the data
type of
> > t?? where can I find it?
>
> Couple of ways you could figure it out... the hack-ish way would be
> to add the following to your migration and then run it:
>
> puts t.class
>
> Or, look at the source for create_table in activerecord/lib/
> active_record/connection_adapters/abstract/schema_statements.rb
>
> That says it''s a TableDefinition object.
>
> -philip
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---