presidentbeef/brakeman — pull request #386 by presidentbeef (2013-08-21 00:57:13+00:00)
Title: Fix how immediate model attributes are detected

Model attributes were being detected by recursively checking call targets for model classes. However, this meant the value detected was usually only a part of the call. Then Brakeman would go back to the entire output and try to match the target to the full call.

For example:

```erb
<%= raw User.find(1).name %>
#match ^-------------^
#full call ^----------------------^
```

That works fine, unless the output includes more than one `User.find`, in which case it might return the wrong value. This happens sometimes because of the way templates (especially HAML) are compiled.

Now Brakeman returns the full match instead of retroactively attempting to find the match.