1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use include? instead of in? for Enumerable#without.

[egilburg]
This commit is contained in:
Juanito Fatas 2015-03-02 11:32:35 +08:00
parent afd1a870f8
commit 7c34548fe0
2 changed files with 1 additions and 2 deletions

View file

@ -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

View file

@ -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