lib/pghero/methods/sequences.rb in pghero-2.7.3 vs lib/pghero/methods/sequences.rb in pghero-2.7.4

- old
+ new

@@ -45,10 +45,11 @@ select_all(sql).zip(slice) do |row, seq| seq[:last_value] = row[:last_value] end end - sequences.sort_by { |s| s[:sequence] } + # use to_s for unparsable sequences + sequences.sort_by { |s| s[:sequence].to_s } end def sequence_danger(threshold: 0.9, sequences: nil) sequences ||= self.sequences sequences.select { |s| s[:last_value] && s[:last_value] / s[:max_value].to_f > threshold }.sort_by { |s| s[:max_value] - s[:last_value] }