Files
2012-02-21 01:15:00 -05:00

1 line
1.6 KiB
JSON

[{"user_id": 5145, "stars": [], "topic_id": 46988, "date_created": 1319481520.586067, "message": "Yup:\n\n\nActiveRecord::Base#dup and ActiveRecord::Base#clone semantics have changed to closer match normal Ruby dup and clone semantics.\nCalling ActiveRecord::Base#clone will result in a shallow copy of the record, including copying the frozen state. No callbacks will be called.\n\nFrom: http://guides.rubyonrails.org/3_1_release_notes.html", "group_id": 447, "id": 2422525}, {"user_id": 5145, "stars": [], "topic_id": 46988, "date_created": 1319481790.9256561, "message": "this line is confusing for me - can someone explain this?\n\nCalling ActiveRecord::Base#clone will result in a shallow copy of the record, including copying the frozen state. No callbacks will be called.\n\nWhat's a shallow copy? Is this like a pointer?", "group_id": 447, "id": 2422545}, {"user_id": 42819, "stars": [], "topic_id": 46988, "date_created": 1320038633.232986, "message": "gg", "group_id": 447, "id": 2475061}, {"user_id": 3356, "stars": [], "topic_id": 46988, "date_created": 1320145111.962718, "message": "A shallow copy would include the objects attributes, but not relationships. For example, if you had an author with many posts, @author.clone would give you a new author instance with a copy of the attributes of @author, but @new_author wouldn't have any posts. For that you would have to iterate over @author.posts, cloning each one and assigning the cloned post to @new_author.posts.", "group_id": 447, "id": 2482777}, {"user_id": 4935, "stars": [], "topic_id": 46988, "date_created": 1320443014.530582, "message": "sounds unsurprising to me :)", "group_id": 447, "id": 2508167}]