thx 2009/6/22 Philip Hallstrom <[email protected]>
> > > 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 [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 -~----------~----~----~----~------~----~------~--~---

