Skip to content

Commit

Permalink
Remove unused Hash.ruby2_keywords_hash? backport
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed May 3, 2022
1 parent 70fc351 commit dce43bb
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions activejob/lib/active_job/arguments.rb
Expand Up @@ -70,28 +70,6 @@ def deserialize(arguments)
private_constant :PERMITTED_TYPES, :RESERVED_KEYS, :GLOBALID_KEY,
:SYMBOL_KEYS_KEY, :RUBY2_KEYWORDS_KEY, :WITH_INDIFFERENT_ACCESS_KEY

unless Hash.respond_to?(:ruby2_keywords_hash?) && Hash.respond_to?(:ruby2_keywords_hash)
using Module.new {
refine Hash do
class << Hash
def ruby2_keywords_hash?(hash)
!new(*[hash]).default.equal?(hash)
end

def ruby2_keywords_hash(hash)
_ruby2_keywords_hash(**hash)
end

private
def _ruby2_keywords_hash(*args)
args.last
end
ruby2_keywords(:_ruby2_keywords_hash)
end
end
}
end

def serialize_argument(argument)
case argument
when *PERMITTED_TYPES
Expand Down

0 comments on commit dce43bb

Please sign in to comment.