mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
ruby: use inline expectation tests
This commit is contained in:
@@ -8,15 +8,15 @@ class DatabaseQueryInLoopTest
|
||||
|
||||
# simple query in loop
|
||||
names.map do |name|
|
||||
User.where(login: name).pluck(:id).first
|
||||
User.where(login: name).pluck(:id).first # $ Alert
|
||||
end
|
||||
|
||||
# nested loop
|
||||
names.map do |name|
|
||||
user = User.where(login: name).pluck(:id).first
|
||||
user = User.where(login: name).pluck(:id).first # $ Alert
|
||||
|
||||
ids.map do |user_id|
|
||||
User.where(id: user_id).pluck(:id).first
|
||||
User.where(id: user_id).pluck(:id).first # $ Alert
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user