user = User.find(:first) user.id # 1 user.name # test clone_user = user.clone dup_user = user.dup # clone ãããªãã¸ã§ã¯ã㯠ID ãå«ã¾ããªã clone_user.id # nil dup_user.id # 1 # clone ãããªãã¸ã§ã¯ã㯠new_record? == true user.new_record? # nil clone_user.new_record? # true dup_user.new_record? # nil # dup ã§è¤è£½ãããªãã¸ã§ã¯ãã¯è¤è£½å ãªãã¸ã§ã¯ãã®å±æ§å¤ãå¤æ´ããã¨å¤ãå¤ãã user.name = 'new name' clone_user.name # test dup_user.name # new name ä¸è¨ã®ãããª
{{#tags}}- {{label}}
{{/tags}}