Skip to content

Commit

Permalink
Use include? instead of in? for Enumerable#without.
Browse files Browse the repository at this point in the history
[egilburg]
  • Loading branch information
JuanitoFatas committed Mar 2, 2015
1 parent afd1a87 commit 7c34548
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/core_ext/enumerable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def exclude?(object)
# {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

Expand Down
1 change: 0 additions & 1 deletion activesupport/test/core_ext/enumerable_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 7c34548

Please sign in to comment.