Better loggin for orhpan delete method

This commit is contained in:
Martin Lensment 2015-03-25 16:52:17 +02:00
parent 8e70bcd6f4
commit e664d46710
2 changed files with 4 additions and 2 deletions

View file

@ -174,7 +174,9 @@ class Contact < ActiveRecord::Base
end
def destroy_orphans
find_orphans.destroy_all
STDOUT << "#{Time.now.utc} - Destroying orphaned contacts\n"
count = find_orphans.destroy_all.count
STDOUT << "#{Time.now.utc} - Successfully destroyed #{count} orphaned contacts\n"
end
end
end