Skip to content
Browse files

adds deprecation warnings to the RDoc of Array#uniq_by(!)

  • Loading branch information...
1 parent 737960d commit 173eacadf1a827c8731e1ff55f396dc59aacc5e3 @fxn fxn committed
Showing with 6 additions and 2 deletions.
  1. +6 −2 activesupport/lib/active_support/core_ext/array/uniq_by.rb
View
8 activesupport/lib/active_support/core_ext/array/uniq_by.rb
@@ -1,5 +1,7 @@
class Array
- # Returns an unique array based on the criteria given as a +Proc+.
+ # *DEPRECATED*: Use +Array#uniq+ instead.
+ #
+ # Returns a unique array based on the criteria in the block.
#
# [1, 2, 3, 4].uniq_by { |i| i.odd? } # => [1, 2]
#
@@ -9,7 +11,9 @@ def uniq_by(&block)
uniq(&block)
end
- # Same as uniq_by, but modifies self.
+ # *DEPRECATED*: Use +Array#uniq!+ instead.
+ #
+ # Same as +uniq_by+, but modifies +self+.
def uniq_by!(&block)
ActiveSupport::Deprecation.warn "uniq_by! " \
"is deprecated. Use Array#uniq! instead", caller

0 comments on commit 173eaca

Please sign in to comment.
Something went wrong with that request. Please try again.