diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-30 14:37:20 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-06-03 11:33:53 -0700 |
commit | eaaf8995b13e411f6ecff2a0fcd515e8b4b7a42d (patch) | |
tree | a6da48ad05cb4f723ec87da3c618520329d2f62e /actionpack/lib/action_dispatch/routing | |
parent | 981029b3ffdeaae8d70640cbf1bd4884eca7e51b (diff) | |
download | rails-eaaf8995b13e411f6ecff2a0fcd515e8b4b7a42d.tar.gz rails-eaaf8995b13e411f6ecff2a0fcd515e8b4b7a42d.tar.bz2 rails-eaaf8995b13e411f6ecff2a0fcd515e8b4b7a42d.zip |
remove options as an ivar
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index b54367eceb..42d5dbe944 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -62,7 +62,7 @@ module ActionDispatch class Mapping #:nodoc: ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z} - attr_reader :options, :requirements, :conditions, :defaults + attr_reader :requirements, :conditions, :defaults attr_reader :to, :default_controller, :default_action, :as, :anchor def initialize(scope, path, options) @@ -85,10 +85,12 @@ module ActionDispatch path = normalize_path! path, formatted ast = path_ast path path_params = path_params ast - @options = normalize_options!(options, formatted, path_params, ast, scope[:module]) + options = normalize_options!(options, formatted, path_params, ast, scope[:module]) - constraints = constraints(options_constraints, + + constraints = constraints(options, + options_constraints, (scope[:constraints] || {}), path_params) @@ -98,7 +100,7 @@ module ActionDispatch @conditions[:parsed_path_info] = ast add_request_method(via, @conditions) - normalize_defaults!(formatted, options_constraints) + normalize_defaults!(options, formatted, options_constraints) end def to_route @@ -178,7 +180,7 @@ module ActionDispatch end end - def normalize_defaults!(formatted, options_constraints) + def normalize_defaults!(options, formatted, options_constraints) options.each do |key, default| unless Regexp === default @defaults[key] = default @@ -302,7 +304,7 @@ module ActionDispatch end end - def constraints(option_constraints, constraints, path_params) + def constraints(options, option_constraints, constraints, path_params) required_defaults = [] options.each_pair do |key, option| if Regexp === option |