mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
push the formatter up to the Route object
This commit is contained in:
parent
e17aead83c
commit
620cb01676
2 changed files with 4 additions and 4 deletions
|
@ -28,11 +28,10 @@ module ActionDispatch
|
|||
@required_names = nil
|
||||
@re = nil
|
||||
@offsets = nil
|
||||
@format = Visitors::FormatBuilder.new.accept(spec)
|
||||
end
|
||||
|
||||
def format_path(path_options)
|
||||
@format.evaluate path_options
|
||||
def build_formatter
|
||||
Visitors::FormatBuilder.new.accept(spec)
|
||||
end
|
||||
|
||||
def ast
|
||||
|
|
|
@ -31,6 +31,7 @@ module ActionDispatch
|
|||
@parts = nil
|
||||
@decorated_ast = nil
|
||||
@precedence = 0
|
||||
@formatter = @path.build_formatter
|
||||
end
|
||||
|
||||
def ast
|
||||
|
@ -76,7 +77,7 @@ module ActionDispatch
|
|||
value.to_s == defaults[key].to_s && !required_parts.include?(key)
|
||||
end
|
||||
|
||||
path.format_path path_options
|
||||
@formatter.evaluate path_options
|
||||
end
|
||||
|
||||
def optimized_path
|
||||
|
|
Loading…
Reference in a new issue