Module: ActiveRecordInstanceCount::HashUtils

Defined in:
lib/active-record-instance-count/utils/hash_utils.rb

Class Method Summary collapse

Class Method Details

.to_sorted_array(hsh) ⇒ Object



4
5
6
# File 'lib/active-record-instance-count/utils/hash_utils.rb', line 4

def self.to_sorted_array(hsh)
  hsh.sort{ |a, b| b[1] <=>a [1] }.collect { |k,v| "#{k}: #{v}" }
end