Skip to content

Commit

Permalink
Merge pull request #1655 from presidentbeef/root_in_routes
Browse files Browse the repository at this point in the history
Calls to `root` in routes might not be `root to: ...`
  • Loading branch information
presidentbeef committed Dec 15, 2021
2 parents 4585df4 + 743eebd commit e05a6e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/brakeman/processors/lib/rails3_route_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def process_namespace exp

#TODO: Need test for this
def process_root exp
return exp unless hash? exp.first_arg

if value = hash_access(exp.first_arg, :to)
if string? value
add_route_from_string value
Expand Down
2 changes: 2 additions & 0 deletions test/apps/rails4/config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
something.root

Rails4::Application.routes.draw do
resources not_a_symbol, :controller => :whatever

Expand Down

0 comments on commit e05a6e8

Please sign in to comment.