Ruby: Fix <<

This commit is contained in:
Harry Maclean
2022-08-09 13:42:29 +12:00
parent e3115b5ed7
commit 22d7b046ab
2 changed files with 6 additions and 1 deletions

View File

@@ -618,7 +618,9 @@ private class ActiveRecordAssociationMethodCall extends DataFlow::CallNode {
(
assoc.isCollection() and
(
this.getMethodName() = pluralize(model) + ["", "=", "<<"]
this.getMethodName() = pluralize(model) + ["", "="]
or
this.getMethodName() = "<<"
or
this.getMethodName() = model + ["_ids", "_ids="]
)

View File

@@ -39,6 +39,7 @@ activeRecordInstances
| associations.rb:27:9:27:28 | call to create |
| associations.rb:29:1:29:7 | author2 |
| associations.rb:29:1:29:13 | call to posts |
| associations.rb:29:1:29:22 | ... << ... |
| associations.rb:29:18:29:22 | post2 |
| associations.rb:31:1:31:5 | post1 |
| associations.rb:31:1:31:12 | __synth__0 |
@@ -175,6 +176,8 @@ activeRecordModelInstantiations
| associations.rb:27:9:27:21 | call to posts | associations.rb:5:1:9:3 | Post |
| associations.rb:27:9:27:28 | call to create | associations.rb:5:1:9:3 | Post |
| associations.rb:29:1:29:13 | call to posts | associations.rb:5:1:9:3 | Post |
| associations.rb:29:1:29:22 | ... << ... | associations.rb:11:1:13:3 | Tag |
| associations.rb:29:1:29:22 | ... << ... | associations.rb:15:1:17:3 | Comment |
| associations.rb:31:1:31:12 | call to author= | associations.rb:1:1:3:3 | Author |
| associations.rb:35:1:35:14 | call to comments | associations.rb:15:1:17:3 | Comment |
| associations.rb:35:1:35:21 | call to create | associations.rb:15:1:17:3 | Comment |