Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
* master:
  Update version and changelog
  Improve dummy app configuration
  • Loading branch information
tagliala committed Jul 28, 2023
2 parents ed4ecf6 + 4006d7f commit bb1da9f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 13.2.1 / 2023-07-28

* [BUGFIX] Fix deprecation on Rails Edge

## 13.2.0 / 2023-07-28

* [FEATURE] Add option for standard nested separator ([#285](https://github.com/enriclluelles/route_translator/pull/285))
Expand Down
7 changes: 6 additions & 1 deletion lib/route_translator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
require 'route_translator/extensions'
require 'route_translator/translator'
require 'route_translator/host'
require 'route_translator/version'

module RouteTranslator
extend RouteTranslator::Host
Expand Down Expand Up @@ -39,7 +40,7 @@ def resolve_host_locale_config_conflicts
def check_deprecations
return if @config.i18n_use_slash_separator

ActiveSupport::Deprecation.warn <<~MSG
deprecator.warn <<~MSG
`i18n_use_slash_separator` set to `false` is deprecated and will be
removed in the next major release of Route Translator to match
Rails' ActiveRecord nested model syntax.
Expand Down Expand Up @@ -90,4 +91,8 @@ def locale_from_params(params)
locale = params[config.locale_param_key]&.to_sym
locale if I18n.available_locales.include?(locale)
end

def deprecator
@deprecator ||= ActiveSupport::Deprecation.new(RouteTranslator::VERSION, 'RouteTranslator')
end
end
2 changes: 1 addition & 1 deletion lib/route_translator/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module RouteTranslator
VERSION = '13.2.0'
VERSION = '13.2.1'
end
1 change: 1 addition & 0 deletions test/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ module Dummy
class Application < Rails::Application
config.active_support.deprecation = :log
config.eager_load = false
config.active_support.cache_format_version = 7.0 if Rails.version >= '7.0'
end
end
6 changes: 3 additions & 3 deletions test/integration/i18n_slash_separator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ def teardown
end

def test_deprecation_when_default
assert_deprecated('i18n_use_slash_separator') do
assert_deprecated('i18n_use_slash_separator', RouteTranslator.deprecator) do
RouteTranslator.config
end
end

def test_deprecation_when_false
config_i18n_use_slash_separator false

assert_deprecated('i18n_use_slash_separator') do
assert_deprecated('i18n_use_slash_separator', RouteTranslator.deprecator) do
RouteTranslator.config
end
end

def test_no_deprecation_when_true
config_i18n_use_slash_separator true

assert_not_deprecated do
assert_not_deprecated(RouteTranslator.deprecator) do
RouteTranslator.config
end
end
Expand Down

0 comments on commit bb1da9f

Please sign in to comment.