diff options
author | John Gesimondo <john@jmondo.com> | 2013-05-26 20:27:49 -0700 |
---|---|---|
committer | John Gesimondo <john@jmondo.com> | 2013-05-28 22:15:55 -0700 |
commit | c3ec0dbdd4279cb9273194a8ed8f8d9dcdf54816 (patch) | |
tree | 7b4791bdf44f58c76a94826eebfa64807689250a /activerecord | |
parent | 50e89373c5e0b6ad2878346286277666752497b6 (diff) | |
download | rails-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.rb | 2 |
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 |