Skip to content

Commit

Permalink
Merge pull request #39666 from kamipo/use_native_hash_except
Browse files Browse the repository at this point in the history
Use native `Hash#except` if it is defined
  • Loading branch information
kamipo authored and eugeneius committed Jan 2, 2021
1 parent b547765 commit f64f7c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/core_ext/hash/except.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Hash
# @person.update(params[:person].except(:admin))
def except(*keys)
slice(*self.keys - keys)
end
end unless method_defined?(:except)

# Removes the given keys from hash and returns it.
# hash = { a: true, b: false, c: nil }
Expand Down

0 comments on commit f64f7c6

Please sign in to comment.