diff options
author | eileencodes <eileencodes@gmail.com> | 2015-05-31 18:51:33 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2015-05-31 18:51:33 -0400 |
commit | f6b01c1d064486eb54fe2f63b8c8163ac26a29ec (patch) | |
tree | 42058c11b9cb45f74c610212cc851f2b308cc08c | |
parent | 1a4f470d59795f51c29f9eddccccbc4b371d808c (diff) | |
download | rails-f6b01c1d064486eb54fe2f63b8c8163ac26a29ec.tar.gz rails-f6b01c1d064486eb54fe2f63b8c8163ac26a29ec.tar.bz2 rails-f6b01c1d064486eb54fe2f63b8c8163ac26a29ec.zip |
Use `any?` rather than `present?` to check args
It's better to use Ruby methods when possible over methods defined by
Active Support because then it does not need to rely on any
dependencies.
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/testing/integration.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index bd88b20cea..7464dd7969 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -556,7 +556,7 @@ module ActionController args.first.merge!(method: http_method) process(action, *args) else - non_kwarg_request_warning if args.present? + non_kwarg_request_warning if args.any? args = args.unshift(http_method) process(action, *args) diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb index f953429e96..dff809f6cd 100644 --- a/actionpack/lib/action_dispatch/testing/integration.rb +++ b/actionpack/lib/action_dispatch/testing/integration.rb @@ -294,7 +294,7 @@ module ActionDispatch if kwarg_request?(args) process(http_method, path, *args) else - non_kwarg_request_warning if args.present? + non_kwarg_request_warning if args.any? process(http_method, path, { params: args[0], headers: args[1] }) end end |