Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
westonganger committed Oct 21, 2021
1 parent 868f3ba commit 5053470
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,20 @@ def locales_dir
end

def self.test(*args, **opts, &block)
if !opts.has_key?(:cache_translations)
super(*args, &block)
else
cache_translations = opts.delete(:cache_translations)
if opts[:cache_translations] != I18n::Backend::ActiveRecord.config.cache_translations
cache_translations_was = I18n::Backend::ActiveRecord.config.cache_translations

if cache_translations
cache_translations_was = I18n::Backend::ActiveRecord.config.cache_translations

I18n::Backend::ActiveRecord.config.cache_translations = opts[:cache_translations]
I18n::Backend::ActiveRecord.config.cache_translations = opts[:cache_translations]
end

cache_suffix = "Cache Translations: #{I18n::Backend::ActiveRecord.config.cache_translations}"
cache_suffix = "Cache Translations: #{I18n::Backend::ActiveRecord.config.cache_translations}"

args[0] = [args[0], cache_suffix].join(", ")
end
args[0] = [args[0], cache_suffix].join(" ")

super(*args, &block)
super(*args, &block)

if cache_translations
I18n::Backend::ActiveRecord.config.cache_translations = cache_translations_was
end
if cache_translations_was
I18n::Backend::ActiveRecord.config.cache_translations = cache_translations_was
end
end
end

0 comments on commit 5053470

Please sign in to comment.