diff options
author | Richard Schneeman <richard.schneeman@gmail.com> | 2015-03-01 23:00:08 -0600 |
---|---|---|
committer | Richard Schneeman <richard.schneeman@gmail.com> | 2015-03-01 23:00:08 -0600 |
commit | c34a5bff94e2af111f7c7f8f0bce8f94e1fd798b (patch) | |
tree | 5c9c2939bc4ecb620efcac58baa0df25043e04d2 | |
parent | 485e125668cb3a3d5523dcef78e5155ea1957d9e (diff) | |
parent | 7c34548fe0c7c5078fe9672e236630597be50d13 (diff) | |
download | rails-c34a5bff94e2af111f7c7f8f0bce8f94e1fd798b.tar.gz rails-c34a5bff94e2af111f7c7f8f0bce8f94e1fd798b.tar.bz2 rails-c34a5bff94e2af111f7c7f8f0bce8f94e1fd798b.zip |
Merge pull request #19163 from JuanitoFatas/feautre/enumerable-without-take-2
Use include? instead of in? for Enumerable#without.
-rw-r--r-- | activesupport/lib/active_support/core_ext/enumerable.rb | 2 | ||||
-rw-r--r-- | activesupport/test/core_ext/enumerable_test.rb | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/enumerable.rb b/activesupport/lib/active_support/core_ext/enumerable.rb index d699cf4241..7a893292b3 100644 --- a/activesupport/lib/active_support/core_ext/enumerable.rb +++ b/activesupport/lib/active_support/core_ext/enumerable.rb @@ -69,7 +69,7 @@ module Enumerable # {foo: 1, bar: 2, baz: 3}.without :bar # => {foo: 1, baz: 3} def without(*elements) - reject { |element| element.in?(elements) } + reject { |element| elements.include?(element) } end end diff --git a/activesupport/test/core_ext/enumerable_test.rb b/activesupport/test/core_ext/enumerable_test.rb index c8123a022a..e5d8ae7882 100644 --- a/activesupport/test/core_ext/enumerable_test.rb +++ b/activesupport/test/core_ext/enumerable_test.rb @@ -1,7 +1,6 @@ require 'abstract_unit' require 'active_support/core_ext/array' require 'active_support/core_ext/enumerable' -require 'active_support/core_ext/object/inclusion' Payment = Struct.new(:price) class SummablePayment < Payment |