aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib/active_resource/connection.rb
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2011-04-11 00:52:42 +0800
committerDavid Heinemeier Hansson <david@loudthinking.com>2011-04-11 03:17:09 +0800
commita9f3c9da01d721963d05949604ead909aaabbf36 (patch)
tree5e278655997e1dcf86d9e0ee2f6be30d323fc8b4 /activeresource/lib/active_resource/connection.rb
parent635d991683c439da56fa72853880e88e6ac291ed (diff)
downloadrails-a9f3c9da01d721963d05949604ead909aaabbf36.tar.gz
rails-a9f3c9da01d721963d05949604ead909aaabbf36.tar.bz2
rails-a9f3c9da01d721963d05949604ead909aaabbf36.zip
Using Object#in? and Object#either? in various places
There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
Diffstat (limited to 'activeresource/lib/active_resource/connection.rb')
-rw-r--r--activeresource/lib/active_resource/connection.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activeresource/lib/active_resource/connection.rb b/activeresource/lib/active_resource/connection.rb
index 480f2fbecb..09d0659b43 100644
--- a/activeresource/lib/active_resource/connection.rb
+++ b/activeresource/lib/active_resource/connection.rb
@@ -1,5 +1,6 @@
require 'active_support/core_ext/benchmark'
require 'active_support/core_ext/uri'
+require 'active_support/core_ext/object/inclusion'
require 'net/https'
require 'date'
require 'time'
@@ -277,7 +278,7 @@ module ActiveResource
def legitimize_auth_type(auth_type)
return :basic if auth_type.nil?
auth_type = auth_type.to_sym
- [:basic, :digest].include?(auth_type) ? auth_type : :basic
+ auth_type.either?(:basic, :digest) ? auth_type : :basic
end
end
end