mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Enable Lint/ShadowingOuterLocalVariable for Rubocop.
This commit is contained in:
@@ -20,12 +20,12 @@ module ActiveSupport
|
||||
uncached = "#{method_name}_without_cache"
|
||||
alias_method uncached, method_name
|
||||
|
||||
define_method(method_name) do |*args|
|
||||
define_method(method_name) do |*arguments|
|
||||
# this avoids recursive locks
|
||||
found = true
|
||||
data = cache.fetch(args) { found = false }
|
||||
data = cache.fetch(arguments) { found = false }
|
||||
unless found
|
||||
cache[args] = data = send(uncached, *args)
|
||||
cache[arguments] = data = send(uncached, *arguments)
|
||||
end
|
||||
# so cache is never corrupted
|
||||
data.dup
|
||||
@@ -45,9 +45,10 @@ module ActiveSupport
|
||||
args.each do |method_name|
|
||||
orig = "#{method_name}_without_clear_memoize"
|
||||
alias_method orig, method_name
|
||||
define_method(method_name) do |*args|
|
||||
|
||||
define_method(method_name) do |*arguments|
|
||||
ActiveSupport::Inflector.clear_memoize!
|
||||
send(orig, *args)
|
||||
send(orig, *arguments)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -41,9 +41,11 @@ module I18n
|
||||
I18n.backend.load_translations(I18n.load_path.grep(/\.rb$/))
|
||||
|
||||
# load plural rules from plugins
|
||||
DiscoursePluginRegistry.locales.each do |locale, options|
|
||||
DiscoursePluginRegistry.locales.each do |plugin_locale, options|
|
||||
if options[:plural]
|
||||
I18n.backend.store_translations(locale, i18n: { plural: options[:plural] })
|
||||
I18n.backend.store_translations(plugin_locale,
|
||||
i18n: { plural: options[:plural] }
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user