开发者

When are 'created_at' and 'updated_at' set?

开发者 https://www.devze.com 2023-03-09 17:32 出处:网络
I\'m trying to use the created_at and updated_at in my before_create but they do not appear to be se开发者_开发问答t. Any idea when they are set? Thanks!created_at attribute is set automatically after

I'm trying to use the created_at and updated_at in my before_create but they do not appear to be se开发者_开发问答t. Any idea when they are set? Thanks!


created_at attribute is set automatically after object is created, updated_at -- updates after every updating. So, I guess, you cant use it before creating an object

0

精彩评论

暂无评论...
验证码 换一张
取 消