A platform for community discussion. Free, open, simple.
DEV: correct some Ruby 2.7 deprecations
Sam Saffron906a84d66ff8
diff --git a/lib/freedom_patches/inflector_backport.rb b/lib/freedom_patches/inflector_backport.rbindex e61f3135ad2..67547cddadb 100644--- a/lib/freedom_patches/inflector_backport.rb+++ b/lib/freedom_patches/inflector_backport.rb@@ -22,7 +22,7 @@ module ActiveSupportuncached = "#{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 locksfound = truedata = cache.fetch(arguments) { found = false }@@ -32,6 +32,11 @@ module ActiveSupport# so cache is never corrupteddata.dupend++ # https://bugs.ruby-lang.org/issues/16897+ if Module.respond_to?(:ruby2_keywords, true)+ ruby2_keywords(m)+ endendenddiff --git a/lib/plugin/instance.rb b/lib/plugin/instance.rbindex 01ac0303284..fcbe75c58d2 100644--- a/lib/plugin/instance.rb+++ b/lib/plugin/instance.rb@@ -248,7 +248,7 @@ class Plugin::Instancehidden_method_name = :"#{method_name}_without_enable_check"klass.public_send(:define_method, hidden_method_name, &block)- klass.public_send(callback, options) do |*args|+ klass.public_send(callback, **options) do |*args|public_send(hidden_method_name, *args) if plugin.enabled?enddiff --git a/lib/seed_data/categories.rb b/lib/seed_data/categories.rbindex f0617c91291..c4e2948bba4 100644--- a/lib/seed_data/categories.rb+++ b/lib/seed_data/categories.rb@@ -12,7 +12,7 @@ module SeedDatadef create(site_setting_names: nil)I18n.with_locale(@locale) do- categories(site_setting_names).each { |params| create_category(params) }+ categories(site_setting_names).each { |params| create_category(**params) }endend