diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-12 17:23:40 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-12 17:24:23 -0700 |
commit | ba7602b881b95666c3f076f8522d9eeaac8eeefb (patch) | |
tree | 7b1d849acb499ee2c21ce39bcc88eebc62fadfea /actionpack/lib/action_dispatch | |
parent | dc3230b156a4cfe5a8fbe3636edf0117f8e122cc (diff) | |
download | rails-ba7602b881b95666c3f076f8522d9eeaac8eeefb.tar.gz rails-ba7602b881b95666c3f076f8522d9eeaac8eeefb.tar.bz2 rails-ba7602b881b95666c3f076f8522d9eeaac8eeefb.zip |
remove the `add_request_method` method
I didn't like this method because it mutates the parameters. Now that
the method is so small, just push it up to `initialize`
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index bcc0e6fe9f..887b5957df 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -126,8 +126,9 @@ module ActionDispatch @conditions[:required_defaults] = (split_options[:required_defaults] || []).map(&:first) @conditions[:path_info] = path @conditions[:parsed_path_info] = ast - - add_request_method(via, @conditions) + unless via == [:all] + @conditions[:request_method] = via.map { |m| m.to_s.dasherize.upcase } + end end def to_route @@ -222,11 +223,6 @@ module ActionDispatch Hash[options.reject { |_, default| Regexp === default }] end - def add_request_method(via, conditions) - return if via == [:all] - conditions[:request_method] = via.map { |m| m.to_s.dasherize.upcase } - end - def app(blocks) if to.respond_to?(:call) Constraints.new(to, blocks, Constraints::CALL) |