Improve Rails 3 route processing #116

Merged
merged 11 commits into from Jul 25, 2012

2 participants

@presidentbeef

This patch fixes some issues with Rails 3 route processing.

Improvements include:

  • Handling "controller" blocks
controller :whatever do
  get :something => :else
end
  • Handling routes that don't specify a controller
resource :book do
  get :reserve
end
  • Handling :to options in match
match 'path', :to => 'controller#action'
  • Handling :to options in blocks
resource :book do
  get 'reserve', :to => :checkout
end
@oreoshake oreoshake commented on the diff Jul 25, 2012
lib/brakeman/processors/lib/rails3_route_processor.rb
exp
end
def process_resources_block exp
- process_resources exp[1]
@oreoshake
oreoshake added a line comment Jul 25, 2012

alias :process_resources_block, :process_resource_block?

@presidentbeef
Owner
presidentbeef added a line comment Jul 25, 2012

They are slightly different...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@oreoshake

code climate is making me overthink this, but yeah, 👍

@presidentbeef presidentbeef merged commit 57c2672 into master Jul 25, 2012
@presidentbeef presidentbeef deleted the improve_rails3_route_processing branch Feb 25, 2015
@presidentbeef presidentbeef locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.