Ruby on Rails Friday, September 29, 2017

And rightly so, it violates basic activerecord principles and may well break stuff. 

On Monday, September 25, 2017 at 6:22:12 AM UTC+1, Cassio Almeida wrote:
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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7f79a784-eea8-4243-845d-7da94228d04b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment