mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 14:17:57 +08:00
DEV: correct some Ruby 2.7 deprecations
There are a few left, especially in gems but this makes some progress
This commit is contained in:
@ -22,7 +22,7 @@ module ActiveSupport
|
||||
uncached = "#{method_name}_without_cache"
|
||||
alias_method uncached, method_name
|
||||
|
||||
define_method(method_name) do |*arguments|
|
||||
m = define_method(method_name) do |*arguments|
|
||||
# this avoids recursive locks
|
||||
found = true
|
||||
data = cache.fetch(arguments) { found = false }
|
||||
@ -32,6 +32,11 @@ module ActiveSupport
|
||||
# so cache is never corrupted
|
||||
data.dup
|
||||
end
|
||||
|
||||
# https://bugs.ruby-lang.org/issues/16897
|
||||
if Module.respond_to?(:ruby2_keywords, true)
|
||||
ruby2_keywords(m)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user