Hey guys, how do I manually update created_at and updated_at attributes at the time of object creation, I already know that this does not work:
post = Post.new(
title: “Hello”,
body: “Hello World!”,
created_at: mycreatedate,
updated_at: mychangedate
)
post.save
Colin_Law
(Colin Law)
2
I suggest not doing that. If you want to save datetimes that are not the same as created and updated then add new attributes to do what you want.
Colin
And rightly so, it violates basic activerecord principles and may well break stuff.