class CreateTestData < ActiveRecord::Migration
  def self.up
    down  # Delete all rows from the posts and comments tables

    post1 = Post.create(:id => 1, :title=> "First title", :body=>
"This is the body of the first posting")

    comment = Comment.create(:id => 1, :comment=>"What a boring
posting. Can you do better next time? - Sang Shin")
    post1.comments << comment


I dont understand the following line
 post1.comments << comment

What does '<<' do

Thanks

Ali

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "ruby-on-rails-programming-with-passion" group.
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to