diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-07-20 23:40:54 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-07-20 23:40:54 -0300 |
commit | 8ff777f6f8e1d8538a6294a7aa3bf2598e291d5d (patch) | |
tree | b239f27012044317875a5a602aefc185ae5cc34a /actionpack/lib | |
parent | 94e8b3ac75df5b964e820a7244d3383e193d5898 (diff) | |
parent | da2aa295895bf24acc05d30d1350be99823520e0 (diff) | |
download | rails-8ff777f6f8e1d8538a6294a7aa3bf2598e291d5d.tar.gz rails-8ff777f6f8e1d8538a6294a7aa3bf2598e291d5d.tar.bz2 rails-8ff777f6f8e1d8538a6294a7aa3bf2598e291d5d.zip |
Merge pull request #20751 from repinel/remove-unnecessary-dup
Remove unnecessary `dup` from Mapper `add_route`
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 7cfe4693c1..ec530c6e8a 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1538,7 +1538,7 @@ module ActionDispatch path = path_for_action(action, options.delete(:path)) raise ArgumentError, "path is required" if path.blank? - action = action.to_s.dup + action = action.to_s if action =~ /^[\w\-\/]+$/ options[:action] ||= action.tr('-', '_') unless action.include?("/") |