mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove Array#sum
method before override it
To suppress warning ('warning: method redefined; discarding old sum') remove the method before override it. Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
This commit is contained in:
parent
643cac08a3
commit
cd9d5c1150
1 changed files with 2 additions and 0 deletions
|
@ -112,6 +112,8 @@ end
|
|||
# just calling the compat method in the first place.
|
||||
if Array.instance_methods(false).include?(:sum) && !(%w[a].sum rescue false)
|
||||
class Array
|
||||
remove_method :sum
|
||||
|
||||
def sum(*args) #:nodoc:
|
||||
# Use Enumerable#sum instead.
|
||||
super
|
||||
|
|
Loading…
Reference in a new issue