Skip to content

Instantly share code, notes, and snippets.

@westonganger
Created April 18, 2023 00:43
Show Gist options
  • Save westonganger/864309762eb56d4d07c26ccd862fcae8 to your computer and use it in GitHub Desktop.
Save westonganger/864309762eb56d4d07c26ccd862fcae8 to your computer and use it in GitHub Desktop.
def self.with_fresh_i18n_load_paths(load_paths, &block)
prev_load_path = I18n.load_path
I18n.load_path = load_paths
I18n.backend.reload!
block.call
ensure
I18n.load_path = prev_load_path
I18n.backend.reload!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment