Created
April 29, 2010 14:55
-
-
Save Sailias/383724 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
>> @article = Article.new | |
@article = Article.new | |
=> #<Article id: nil, created_at: nil, updated_at: nil> | |
>> @article.comments.build(:content=>"Hello") | |
@article.comments.build(:content=>"Hello") | |
=> #<Comment id: nil, created_at: nil, updated_at: nil, content: "Hello", commentable_id: nil, commentable_type: "Article"> | |
>> @article.save | |
@article.save | |
=> true | |
>> @comment = @article.comments.last | |
@comment = @article.comments.last | |
=> #<Comment id: 2, created_at: "2010-04-29 14:54:07", updated_at: "2010-04-29 14:54:07", content: "Hello", commentable_id: 2, commentable_type: "Article"> | |
>> @comment.update_attributes(:commentable_id=>"", :commentable_type=>"") | |
@comment.update_attributes(:commentable_id=>"", :commentable_type=>"") | |
=> true | |
>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment