Comments
-
Greg Hurrell
Status changed:
- From: new
- To: open
-
Greg Hurrell
Ok, I've committed a "quick and dirty" fix so that I can go ahead and deploy.
Will look into a more elegant solution (new Rails functionality for updated records without touching timestamps) subsequently.
-
Greg Hurrell
I am pretty sure I've seen a new API for this but I can't find it... only these old discussions:
-
Greg Hurrell
I think I might have found the thing I was thinking of here:
You can now specify a particular timestamp for updated_at timestamps:
cust = Customer.create(:name => "ABC Industries", :updated_at => 1.day.ago)
(commit)Looks like that won't help as it only applies to the
create
method.Trying
model.update_attributes :awaiting_moderation => false, :updated_at => model.updated_at
won't work anyway becauseupdated_at
is a protected attribute.This won't work either (new timestamp gets written out anyway):
model.awaiting_moderation = false model.updated_at = model.updated_at
So looks like temporarily doing
Model.record_timestamps = false
might be the only way to do it, and that will obviously only work as long as I run Rails in single-threaded mode. -
Greg Hurrell
Ok, have implemented my preferred fix for now. Marking as closed.
-
Greg Hurrell
Status changed:
- From: open
- To: closed
Add a comment
Comments are now closed for this issue.