Skip to content

Commit e3115b5

Browse files
committed
Ruby: Add test for other=
1 parent 831f722 commit e3115b5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ruby/ql/test/library-tests/frameworks/active_record/ActiveRecord.expected

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ activeRecordInstances
4040
| associations.rb:29:1:29:7 | author2 |
4141
| associations.rb:29:1:29:13 | call to posts |
4242
| associations.rb:29:18:29:22 | post2 |
43+
| associations.rb:31:1:31:5 | post1 |
44+
| associations.rb:31:1:31:12 | __synth__0 |
45+
| associations.rb:31:1:31:12 | call to author= |
46+
| associations.rb:31:1:31:22 | ... |
47+
| associations.rb:31:16:31:22 | ... = ... |
48+
| associations.rb:31:16:31:22 | ... = ... |
49+
| associations.rb:31:16:31:22 | author2 |
4350
| associations.rb:35:1:35:5 | post2 |
4451
| associations.rb:35:1:35:14 | call to comments |
4552
| associations.rb:35:1:35:21 | call to create |
@@ -168,6 +175,7 @@ activeRecordModelInstantiations
168175
| associations.rb:27:9:27:21 | call to posts | associations.rb:5:1:9:3 | Post |
169176
| associations.rb:27:9:27:28 | call to create | associations.rb:5:1:9:3 | Post |
170177
| associations.rb:29:1:29:13 | call to posts | associations.rb:5:1:9:3 | Post |
178+
| associations.rb:31:1:31:12 | call to author= | associations.rb:1:1:3:3 | Author |
171179
| associations.rb:35:1:35:14 | call to comments | associations.rb:15:1:17:3 | Comment |
172180
| associations.rb:35:1:35:21 | call to create | associations.rb:15:1:17:3 | Comment |
173181
| associations.rb:37:1:37:13 | call to posts | associations.rb:5:1:9:3 | Post |
@@ -206,3 +214,4 @@ persistentWriteAccesses
206214
| ActiveRecord.rb:88:5:88:69 | call to update | ActiveRecord.rb:88:27:88:39 | ...[...] |
207215
| ActiveRecord.rb:88:5:88:69 | call to update | ActiveRecord.rb:88:52:88:68 | ...[...] |
208216
| ActiveRecord.rb:92:5:92:71 | call to update | ActiveRecord.rb:92:21:92:70 | call to [] |
217+
| associations.rb:31:16:31:22 | ... = ... | associations.rb:31:16:31:22 | author2 |

ruby/ql/test/library-tests/frameworks/active_record/associations.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Comment < ActiveRecord::Base
2828

2929
author2.posts << post2
3030

31-
31+
post1.author = author2
3232

3333
# The final method call in this chain should not be recognised as an
3434
# instantiation.

0 commit comments

Comments
 (0)