Skip to content

Commit

Permalink
Fix deprecation warning about i18n errors (#1961)
Browse files Browse the repository at this point in the history
For example:

DEPRECATION WARNING: action_view.raise_on_missing_translations is
deprecated and will be removed in Rails 6.2. Set i18n.raise_on_missing_translations
instead. Note that this new setting also affects how missing translations
are handled in controllers. (called from load at ./bin/rspec:7)
  • Loading branch information
pablobm authored Apr 16, 2021
1 parent dba752d commit 96ac109
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/example_app/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
config.assets.quiet = true

# Raises error for missing translations.
if Rails::VERSION::MAJOR <= 6
if Gem::Version.new(Rails.version) <= Gem::Version.new("6.1")
config.action_view.raise_on_missing_translations = true
else
config.i18n.raise_on_missing_translations = true
Expand Down
2 changes: 1 addition & 1 deletion spec/example_app/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
config.active_support.disallowed_deprecation_warnings = []

# Raises error for missing translations.
if Rails::VERSION::MAJOR <= 6
if Gem::Version.new(Rails.version) <= Gem::Version.new("6.1")
config.action_view.raise_on_missing_translations = true
else
config.i18n.raise_on_missing_translations = true
Expand Down

0 comments on commit 96ac109

Please sign in to comment.