Skip to content

Commit b5dcb8d

Browse files
authored
Use consistent variable names in Query.preload doc (#3765)
1 parent c003039 commit b5dcb8d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/ecto/query.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,22 +632,22 @@ defmodule Ecto.Query do
632632
633633
We can write it as a join expression:
634634
635-
set = from(p in Post,
635+
subset = from(p in Post,
636636
where: p.synced == false and
637637
(is_nil(p.sync_started_at) or p.sync_started_at < ^min_sync_started_at),
638638
limit: ^batch_size
639639
)
640640
641641
Repo.update_all(
642-
from(p in Post, join: s in subquery(set), on: s.id == p.id),
642+
from(p in Post, join: s in subquery(subset), on: s.id == p.id),
643643
set: [sync_started_at: NaiveDateTime.utc_now()]
644644
)
645645
646646
Or as a `where` condition:
647647
648-
subset = from(p in subset, select: p.id)
648+
subset_ids = from(p in subset, select: p.id)
649649
Repo.update_all(
650-
from(p in Post, where: p.id in subquery(subset)),
650+
from(p in Post, where: p.id in subquery(subset_ids)),
651651
set: [sync_started_at: NaiveDateTime.utc_now()]
652652
)
653653

0 commit comments

Comments
 (0)