This may sound like an odd request, however, I have am using impressionist, and using a cached hit column. I am also updating another column everytime it gets a hit, which is a separate calculation.
I don't want to update updated_at at this time, is there a way to skip that?
if impressionist(@topic, "message...", :unique => [:session_hash])
@topic.increment(:exp, 1).save
end
Thanks
The update_columns method from ActiveRecord::Persistence
will do what you want.
In addition to disabling timestamps for an entire class (which isn't thread safe), you can disable timestamps for an individual instance:
@topic.record_timestamps = false
@topic.increment(:exp, 1).save
This instance will not create or update timestamps until timestamps are re-enabled for it. This only affects this particular instance, other instances (even if they refer to the same row in the database) are not affected.
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