Use Update Rather Than Save?
Hey
Just a query ref: https://github.com/ctide/devise_lastseenable/blob/2fbfdc490e0a032d98070d6aae30bb332715b5a7/lib/devise_lastseenable/model.rb#L6-L11
This is causing validations (ie validates_presence_of) against the User model to fail when it's trying to perform the update for the last seen timestamp. Rather than saving here, can this not just make use of update_column so that validations etc aren't triggered?
def stamp!
self.update_column(:last_seen, DateTime.now) if self.last_seen.to_i < (Time.now - 5.minutes).to_i
end
I know we made a similar update to this a while ago, and it broke due to another change, I believe, in that PR. Unfortunately, I haven't written any ruby code in years, and don't have any reasonable way to test/verify any changes so I'm reluctant to touch this thing.
I know it's not really a great response, but I'd recommend forking and just using your own version of it.
+1
Could you please alse use Time.current instead of Time.now and move frequency tine (5 minutes) inside DeviceConfirable ?
- DeviceLastseenable.config