Permalink
Browse files

disconnect path from the instance

  • Loading branch information...
1 parent ffbe1b1 commit b3719d34d2f4db55dd622104ff77ac5970c42d89 @tenderlove tenderlove committed May 29, 2014
Showing with 6 additions and 6 deletions.
  1. +6 −6 actionpack/lib/action_dispatch/routing/mapper.rb
View
12 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -64,24 +64,24 @@ class Mapping #:nodoc:
ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
WILDCARD_PATH = %r{\*([^/\)]+)\)?$}
- attr_reader :scope, :path, :options, :requirements, :conditions, :defaults
+ attr_reader :scope, :options, :requirements, :conditions, :defaults
attr_reader :to, :default_controller, :default_action
def initialize(set, scope, path, options)
- @set, @scope, @path = set, scope, path
+ @set, @scope = set, scope
@requirements, @conditions, @defaults = {}, {}, {}
options = scope[:options].merge(options) if scope[:options]
@to = options[:to]
@default_controller = options[:controller] || scope[:controller]
@default_action = options[:action] || scope[:action]
- @path = normalize_path! @path, options[:format]
- ast = path_ast @path
+ path = normalize_path! path, options[:format]
+ ast = path_ast path
path_params = path_params ast
@options = normalize_options!(options, path_params, ast)
normalize_requirements!(path_params)
- normalize_conditions!(path_params)
+ normalize_conditions!(path_params, path)
normalize_defaults!
end
@@ -193,7 +193,7 @@ def verify_callable_constraint(callable_constraint)
end
end
- def normalize_conditions!(path_params)
+ def normalize_conditions!(path_params, path)
@conditions[:path_info] = path
constraints.each do |key, condition|

0 comments on commit b3719d3

Please sign in to comment.