Skip to content

Commit febe602

Browse files
committed
Coding style
1 parent bb3d2ae commit febe602

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/route_translator/core_ext/mapper_patch.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ def localized_add_route(action, controller, options, _path, to, via, formatted,
6565

6666

6767
def _add_localized_route(scope, set, ast, controller, default_action, to, via, formatted, options_constraints, anchor, options, mapping, as, path, engine)
68-
route = RouteTranslator::Route.new(set, path, as, options_constraints, options, mapping)
6968
translator = RouteTranslator.translator_for(engine)
70-
7169
raise RouteTranslator::TranslatorNotFound, "RouteTranslator is not configured for current engine : #{engine}" if translator.nil?
7270

71+
route = RouteTranslator::Route.new(set, path, as, options_constraints, options, mapping)
72+
7373
translator.translations_for(route) do |locale, translated_name, translated_path, translated_options_constraints, translated_options|
7474
translated_path_ast = ::ActionDispatch::Journey::Parser.parse(translated_path)
7575
translated_mapping = _translate_mapping(locale, set, translated_options, translated_path_ast, scope, controller, default_action, to, formatted, via, translated_options_constraints, anchor)

lib/route_translator/core_ext/mapper_patch81.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ def localized_add_route(action, controller, as, options_action, _path, to, via,
6060

6161

6262
def _add_localized_route(scope, set, ast, controller, default_action, to, via, formatted, options_constraints, anchor, internal, options_mapping, mapping, as, path, engine)
63-
route = RouteTranslator::Route.new(set, path, as, options_constraints, options_mapping, mapping)
6463
translator = RouteTranslator.translator_for(engine)
65-
6664
raise RouteTranslator::TranslatorNotFound, "RouteTranslator is not configured for current engine : #{engine}" if translator.nil?
6765

66+
route = RouteTranslator::Route.new(set, path, as, options_constraints, options_mapping, mapping)
67+
6868
translator.translations_for(route) do |locale, translated_name, translated_path, translated_options_constraints, translated_options|
6969
translated_path_ast = ::ActionDispatch::Journey::Parser.parse(translated_path)
7070
translated_mapping = _translate_mapping(locale, set, translated_options, translated_path_ast, scope, controller, default_action, to, formatted, via, translated_options_constraints, anchor, internal)

0 commit comments

Comments
 (0)