lib/services/statistic_service.rb in codebreaker_paratskiy-0.1.8 vs lib/services/statistic_service.rb in codebreaker_paratskiy-0.1.9

- old
+ new

@@ -8,10 +8,11 @@ name: game.player_name, difficulty: game.difficulty_name, attempts_total: DIFFICULTIES[game.difficulty_name.to_sym][:attempts], attempts_used: DIFFICULTIES[game.difficulty_name.to_sym][:attempts] - game.attempts, hints_total: DIFFICULTIES[game.difficulty_name.to_sym][:hints], - hints_used: DIFFICULTIES[game.difficulty_name.to_sym][:hints] - game.hints + hints_used: DIFFICULTIES[game.difficulty_name.to_sym][:hints] - game.hints, + date: Time.now.gmtime } end def self.sort_stats stats.sort_by { |player| [player[:attempts_total], player[:attempts_used], player[:hints_used]] }