aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJohn Gesimondo <john@jmondo.com>2013-05-26 20:27:49 -0700
committerJohn Gesimondo <john@jmondo.com>2013-05-28 22:15:55 -0700
commitc3ec0dbdd4279cb9273194a8ed8f8d9dcdf54816 (patch)
tree7b4791bdf44f58c76a94826eebfa64807689250a /activerecord
parent50e89373c5e0b6ad2878346286277666752497b6 (diff)
downloadrails-c3ec0dbdd4279cb9273194a8ed8f8d9dcdf54816.tar.gz
rails-c3ec0dbdd4279cb9273194a8ed8f8d9dcdf54816.tar.bz2
rails-c3ec0dbdd4279cb9273194a8ed8f8d9dcdf54816.zip
use grep over select for consistency and efficiency
pass block directly to grep
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index d020f1ba52..0292d363d4 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -1015,7 +1015,7 @@ module ActiveRecord
end
def validate_order_args(args)
- args.select { |a| Hash === a }.each do |h|
+ args.grep(Hash) do |h|
unless (h.values - [:asc, :desc]).empty?
raise ArgumentError, 'Direction should be :asc or :desc'
end