This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby-1.9.2-p0 > b = Blog.create(:title => "This is blog") | |
=> #<Blog _id: 4d529be33e4dd32664000002, title: "This is blog"> | |
ruby-1.9.2-p0 > Blog.count | |
=> 1 | |
ruby-1.9.2-p0 > b.comments.create(:body => "This is body") | |
=> #<Comment _id: 4d529bf63e4dd32664000003, body: "This is body"> | |
ruby-1.9.2-p0 > b.comments.count | |
=> 1 | |
ruby-1.9.2-p0 > reload! | |
Reloading... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby-1.9.2-p0 > b = Blog.first | |
=> #<Blog _id: 4d529be33e4dd32664000002, title: "This is blog"> | |
ruby-1.9.2-p0 > b.comments.length | |
=> 0 | |
ruby-1.9.2-p0 > b.comments.create(:body => "New body again") | |
=> #<Comment _id: 4d529f0c3e4dd329a9000001, body: "New body again"> | |
ruby-1.9.2-p0 > b.comments.count | |
=> 1 | |
ruby-1.9.2-p0 > b.comments.clear | |
=> [] |
NewerOlder