-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Hey
Just a query ref:
devise_lastseenable/lib/devise_lastseenable/model.rb
Lines 6 to 11 in 2fbfdc4
| 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
MrMoins
Metadata
Metadata
Assignees
Labels
No labels