ruby: clean up logic and add test

use the CFG more than the AST
This commit is contained in:
yoff
2025-02-07 23:43:27 +01:00
parent 9d810130e1
commit 921104306a
2 changed files with 27 additions and 12 deletions

View File

@@ -42,6 +42,14 @@ class DatabaseQueryInLoopTest
end
end
# more complicated condition
names.map do |name|
user = User.where(login: name).pluck(:id).first
unless cond && user
raise Error.new("User '#{name}' not found")
end
end
# skipping through the loop when users are not relevant
names.map do |name|
user = User.where(login: name).pluck(:id).first