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:
parent
afd1a870f8
commit
7c34548fe0
2 changed files with 1 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue