Hey
Just a query ref:
|
def stamp! |
|
if self.last_seen.to_i < (Time.now - 5.minutes).to_i |
|
self.last_seen = DateTime.now |
|
self.save! |
|
end |
|
end |
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
Hey
Just a query ref:
devise_lastseenable/lib/devise_lastseenable/model.rb
Lines 6 to 11 in 2fbfdc4
This is causing validations (ie
validates_presence_of) against theUsermodel 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 ofupdate_columnso that validations etc aren't triggered?