aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/hash/diff.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-07-02 23:28:56 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-07-02 23:32:38 -0300
commit01f0c3f308542afa8fa262638d94d10420bd2e78 (patch)
tree04aea74d8c3451b63bb1ec8a0a697cdbf892e681 /activesupport/lib/active_support/core_ext/hash/diff.rb
parentb296edd2d89623f97218fd1693b7a188b01e2171 (diff)
downloadrails-01f0c3f308542afa8fa262638d94d10420bd2e78.tar.gz
rails-01f0c3f308542afa8fa262638d94d10420bd2e78.tar.bz2
rails-01f0c3f308542afa8fa262638d94d10420bd2e78.zip
Remove deprecated Hash#diff with no replacement.
If you're using it to compare hashes for the purpose of testing, please use MiniTest's assert_equal instead.
Diffstat (limited to 'activesupport/lib/active_support/core_ext/hash/diff.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/diff.rb16
1 files changed, 0 insertions, 16 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/diff.rb b/activesupport/lib/active_support/core_ext/hash/diff.rb
deleted file mode 100644
index 4359213380..0000000000
--- a/activesupport/lib/active_support/core_ext/hash/diff.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'active_support/deprecation'
-
-class Hash
- # Returns a hash that represents the difference between two hashes.
- #
- # {1 => 2}.diff(1 => 2) # => {}
- # {1 => 2}.diff(1 => 3) # => {1 => 2}
- # {}.diff(1 => 2) # => {1 => 2}
- # {1 => 2, 3 => 4}.diff(1 => 2) # => {3 => 4}
- def diff(other)
- ActiveSupport::Deprecation.warn "Hash#diff is no longer used inside of Rails, and is being deprecated with no replacement. If you're using it to compare hashes for the purpose of testing, please use MiniTest's assert_equal instead."
- dup.
- delete_if { |k, v| other[k] == v }.
- merge!(other.dup.delete_if { |k, v| has_key?(k) })
- end
-end