From a9f3c9da01d721963d05949604ead909aaabbf36 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Mon, 11 Apr 2011 00:52:42 +0800 Subject: 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?. --- activeresource/lib/active_resource/http_mock.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activeresource/lib/active_resource/http_mock.rb') diff --git a/activeresource/lib/active_resource/http_mock.rb b/activeresource/lib/active_resource/http_mock.rb index 75649053d0..e085a05f6d 100644 --- a/activeresource/lib/active_resource/http_mock.rb +++ b/activeresource/lib/active_resource/http_mock.rb @@ -1,4 +1,5 @@ require 'active_support/core_ext/kernel/reporting' +require 'active_support/core_ext/object/inclusion' module ActiveResource class InvalidRequestError < StandardError; end #:nodoc: @@ -299,7 +300,7 @@ module ActiveResource end def success? - (200..299).include?(code) + code.in?(200..299) end def [](key) -- cgit v1.2.3