changeset 255:a894d7696b7e

More useful return of Paste.fix_all.
author edogawaconan <me@myconan.net>
date Mon, 14 Oct 2013 17:49:52 +0000
parents bcca41003e84
children 0b5f83d99c54
files app/models/paste.rb
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/app/models/paste.rb	Tue Oct 15 01:47:19 2013 +0900
+++ b/app/models/paste.rb	Mon Oct 14 17:49:52 2013 +0000
@@ -52,8 +52,12 @@
   end
 
   def self.fix_all
+    stats = Hash.new(0)
     self.all.each do |p|
       p.save
+      stats[:count] += 1
+      stats[:private] += 1 if p.secret
     end
+    return stats
   end
 end