aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-12-20 08:08:27 -0800
committerXavier Noria <fxn@hashref.com>2011-12-20 08:08:27 -0800
commit173eacadf1a827c8731e1ff55f396dc59aacc5e3 (patch)
treef80a91f86e342deb19f8dcd203ad7108bf31a95e /activesupport
parent737960d92e833d37922296aa789a59de6b7d0533 (diff)
downloadrails-173eacadf1a827c8731e1ff55f396dc59aacc5e3.tar.gz
rails-173eacadf1a827c8731e1ff55f396dc59aacc5e3.tar.bz2
rails-173eacadf1a827c8731e1ff55f396dc59aacc5e3.zip
adds deprecation warnings to the RDoc of Array#uniq_by(!)
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/array/uniq_by.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/uniq_by.rb b/activesupport/lib/active_support/core_ext/array/uniq_by.rb
index edc164dabd..ac3dedc0e3 100644
--- a/activesupport/lib/active_support/core_ext/array/uniq_by.rb
+++ b/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 @@ class Array
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