ActiveRecordã«ã¯ä¾¿å©ãªprevious_changesã¨ããã¡ã½ãããããã¾ãã å²ã¨ç¥å度ãä½ãã®ã§ãããã§ä½¿ãæ¹ããç´¹ä»ãã¾ãã ï¼08/26追è¨ï¼ ã¯ã¦ãã§ãææï¼ï¼ï¼é ãã¾ããããæ£ç¢ºã«ã¯ActiveRecordã§ã¯ãªãActiveModel::Dirtyã®æ©è½ã§ãã ã¾ãã¯changes previous_changesã®åã«åºæ¬ã®changesã§ãã ããã¯ãsaveããåã«å¤æ´ãããattributeã調ã¹ãæ©è½ã§ãã ã¾ãã¯findããç´å¾ã§ããchanged?ã¯å½ç¶falseã«ãªãã¾ãã User.create(name: "Taro") user = User.find(1) user.changed? # => false user.changed [] user.changes # => {} user.changed_attributes # => {
{{#tags}}- {{label}}
{{/tags}}