diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-05-29 05:05:54 -0700 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-05-29 05:05:54 -0700 |
commit | c2f3efffd905f8f21eb5ea88687b738fe8a119a2 (patch) | |
tree | a50723951adb05c6eec6f346397f84a367a08183 /activerecord | |
parent | e1b59a268b30c4a6ff36af56dbc79e3ce3d2e13f (diff) | |
parent | c3ec0dbdd4279cb9273194a8ed8f8d9dcdf54816 (diff) | |
download | rails-c2f3efffd905f8f21eb5ea88687b738fe8a119a2.tar.gz rails-c2f3efffd905f8f21eb5ea88687b738fe8a119a2.tar.bz2 rails-c2f3efffd905f8f21eb5ea88687b738fe8a119a2.zip |
Merge pull request #10767 from jmondo/master
Use grep instead of select with === in QueryMethods
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 fe8fec4dfa..ca1de2d4dc 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -1010,7 +1010,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 |