DEV: Style and performance improvements

Follow-up from 9db8291
This commit is contained in:
David Taylor
2018-12-11 09:58:20 +00:00
parent 671469bcc7
commit 3fedb2ad20
3 changed files with 7 additions and 8 deletions

View File

@ -4,7 +4,7 @@ class UserAssociatedAccount < ActiveRecord::Base
def self.cleanup!
# This happens when a user starts the registration flow, but doesn't complete it
# Keeping the rows doesn't cause any technical issue, but we shouldn't store PII unless it's attached to a user
self.where("user_id IS NULL AND updated_at < ?", 1.day.ago).destroy_all
self.where("user_id IS NULL AND updated_at < ?", 1.day.ago).delete_all
end
end