Sha256: c8e293e6398ebd6739602170e6075dd898301431ce9aba5b7c2d312994998491
Contents?: true
Size: 1.06 KB
Versions: 35
Compression:
Stored size: 1.06 KB
Contents
require 'checks/base_check' #Checks if default routes are allowed in routes.rb class CheckDefaultRoutes < BaseCheck Checks.add self #Checks for :allow_all_actions globally and for individual routes #if it is not enabled globally. def run_check if tracker.routes[:allow_all_actions] #Default routes are enabled globally warn :warning_type => "Default Routes", :message => "All public methods in controllers are available as actions in routes.rb", :line => tracker.routes[:allow_all_actions].line, :confidence => CONFIDENCE[:high], :file => "#{OPTIONS[:app_path]}/config/routes.rb" else #Report each controller separately tracker.routes.each do |name, actions| if actions == :allow_all_actions warn :controller => name, :warning_type => "Default Routes", :message => "Any public method in #{name} can be used as an action.", :confidence => CONFIDENCE[:med], :file => "#{OPTIONS[:app_path]}/config/routes.rb" end end end end end
Version data entries
35 entries across 35 versions & 2 rubygems