lib/brakeman/processors/template_alias_processor.rb in brakeman-3.7.0 vs lib/brakeman/processors/template_alias_processor.rb in brakeman-3.7.1

- old
+ new

@@ -77,15 +77,17 @@ end exp end + COLLECTION_METHODS = [:all, :find, :select, :where] + #Checks if +exp+ is a call to Model.all or Model.find* def get_model_target exp if call? exp target = exp.target - if exp.method == :all or exp.method.to_s[0,4] == "find" + if COLLECTION_METHODS.include? exp.method or exp.method.to_s[0,4] == "find" models = Set.new @tracker.models.keys name = class_name target return target if models.include?(name) end