mirror of https://github.com/rails/rails
alias :without :excluding
Delegation by splat arguments will allocates an extra array.
This commit is contained in:
parent
c6f0861515
commit
d049839e1f
|
@ -1139,11 +1139,7 @@ module ActiveRecord
|
|||
|
||||
spawn.excluding!(records)
|
||||
end
|
||||
|
||||
# Alias for #excluding.
|
||||
def without(*records)
|
||||
excluding(*records)
|
||||
end
|
||||
alias :without :excluding
|
||||
|
||||
def excluding!(records) # :nodoc:
|
||||
predicates = [ predicate_builder[primary_key, records].invert ]
|
||||
|
|
|
@ -47,11 +47,7 @@ class Array
|
|||
def excluding(*elements)
|
||||
self - elements.flatten(1)
|
||||
end
|
||||
|
||||
# Alias for #excluding.
|
||||
def without(*elements)
|
||||
excluding(*elements)
|
||||
end
|
||||
alias :without :excluding
|
||||
|
||||
# Equal to <tt>self[1]</tt>.
|
||||
#
|
||||
|
|
|
@ -152,11 +152,7 @@ module Enumerable
|
|||
elements.flatten!(1)
|
||||
reject { |element| elements.include?(element) }
|
||||
end
|
||||
|
||||
# Alias for #excluding.
|
||||
def without(*elements)
|
||||
excluding(*elements)
|
||||
end
|
||||
alias :without :excluding
|
||||
|
||||
# Extract the given key from each element in the enumerable.
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue