File tree Expand file tree Collapse file tree
app/modules/analytics/controllers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -271,7 +271,8 @@ def build_tournament_stats(matches)
271271
272272 wins = t_matches . victories . count
273273 losses = games - wins
274- patches = t_matches . where . not ( patch_version : nil ) . distinct . pluck ( :patch_version ) . compact . sort
274+ patches = t_matches . where . not ( patch_version : [ nil , '' ] ) . distinct . pluck ( :patch_version ) . compact
275+ . sort_by { |v | v . split ( '.' ) . map ( &:to_i ) }
275276 t_dates = t_matches . where . not ( match_date : nil )
276277
277278 date_range = if t_dates . exists?
@@ -338,7 +339,7 @@ def build_opponents_data(rows)
338339 def build_patch_meta ( rows )
339340 rows . group_by { |m | m . patch_version . presence }
340341 . filter_map { |patch , patch_rows | build_patch_entry ( patch , patch_rows ) }
341- . sort_by { |entry | entry [ :patch ] }
342+ . sort_by { |entry | entry [ :patch ] . split ( '.' ) . map ( & :to_i ) }
342343 . reverse
343344 end
344345
You can’t perform that action at this time.
0 commit comments