FIX: ensure Badge consistency

This commit is contained in:
Régis Hanol 2015-08-14 13:03:49 +02:00
parent b6cd4af2ba
commit b8cf797e31
2 changed files with 5 additions and 0 deletions

View File

@ -12,6 +12,7 @@ module Jobs
PostRevision.ensure_consistency!
UserStat.update_view_counts(13.hours.ago)
Topic.ensure_consistency!
Badge.ensure_consistency!
end
end
end

View File

@ -310,6 +310,10 @@ SQL
end
end
def self.ensure_consistency!
Badge.find_each(&:reset_grant_count!)
end
protected
def ensure_not_system
unless id