Sha256: 04ae6932d52e3d40e7be99ca35adf0c271d1d4441eb6bf71dccc2aa4ab666e69

Contents?: true

Size: 555 Bytes

Versions: 29

Compression:

Stored size: 555 Bytes

Contents

class Array
  # *DEPRECATED*: Use <tt>Array#uniq</tt> instead.
  #
  # Returns a unique array based on the criteria in the block.
  #
  #   [1, 2, 3, 4].uniq_by { |i| i.odd? } # => [1, 2]
  def uniq_by(&block)
    ActiveSupport::Deprecation.warn 'uniq_by is deprecated. Use Array#uniq instead'
    uniq(&block)
  end

  # *DEPRECATED*: Use <tt>Array#uniq!</tt> instead.
  #
  # Same as +uniq_by+, but modifies +self+.
  def uniq_by!(&block)
    ActiveSupport::Deprecation.warn 'uniq_by! is deprecated. Use Array#uniq! instead'
    uniq!(&block)
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
activesupport-4.0.13 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.13.rc1 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.11.1 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.12 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.11 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.10 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.10.rc2 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.10.rc1 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.9 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.8 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.7 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.6 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.6.rc3 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.6.rc2 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.6.rc1 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.5 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.4 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.4.rc1 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.3 lib/active_support/core_ext/array/uniq_by.rb
activesupport-4.0.2 lib/active_support/core_ext/array/uniq_by.rb