From 09d3e89cf0b3e7be03f97739e297fd40ebba1178 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sat, 5 Mar 2011 20:01:06 -0800 Subject: use sort_by instead of sort() --- activesupport/lib/active_support/cache.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb index b4f0c42e37..ddb7a315e2 100644 --- a/activesupport/lib/active_support/cache.rb +++ b/activesupport/lib/active_support/cache.rb @@ -493,7 +493,7 @@ module ActiveSupport key.first.to_param end elsif key.is_a?(Hash) - key = key.to_a.sort{|a,b| a.first.to_s <=> b.first.to_s}.collect{|k,v| "#{k}=#{v}"}.to_param + key = key.to_a.sort_by { |x| x.first.to_s }.collect{|k,v| "#{k}=#{v}"}.to_param else key = key.to_param end -- cgit v1.2.3