Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions frameworks/Ruby/roda-sequel/hello_world.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ def set_default_headers(response)
# Test type 3: Multiple database queries
r.is "queries" do
response[CONTENT_TYPE] = JSON_TYPE
ids = ALL_IDS.sample(bounded_queries)
worlds =
DB.synchronize do
ALL_IDS.sample(bounded_queries).map do |id|
ids.map do |id|
World.with_pk(id).values
end
end
Expand All @@ -69,9 +70,10 @@ def set_default_headers(response)
r.is "updates" do
response[CONTENT_TYPE] = JSON_TYPE
worlds = []
ids = ALL_IDS.sample(bounded_queries)
DB.synchronize do
worlds =
ALL_IDS.sample(bounded_queries).map do |id|
ids.map do |id|
world = World.with_pk(id)
new_value = rand1
new_value = rand1 while new_value == world.randomnumber
Expand Down
Loading