I have a DATETIME column called last_profile_update. I need to update it with a current time. I have the following code:
user = User.new
user.last_profile_update = Date.today
user.save
but it does not work.
Perhaps a way to simplify that code:
user = User.create(:last_profile_update => Time.now)
It could be done with
user.touch(:last_profile_update)
Figured it was Time.now
user = User.new
user.last_profile_update = Time.now
user.save
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With