Skip to content

Commit d2386f7

Browse files
authored
Fixes column order for ROM::SQL::Relation::Reading #join
Website guide does not match with the documentation and behavior for https://api.rom-rb.org/rom-sql/ROM/SQL/Relation/Reading.html#join-instance_method on the order of columns in the conditions hash.
1 parent 374e47b commit d2386f7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docsite/source/joins.html.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ class Users < ROM::Relation[:sql]
4040
end
4141

4242
def with_tasks
43-
join(:tasks, user_id: :id, priority: 1)
43+
join(:tasks, id: :user_id, priority: 1)
4444
end
4545

4646
def with_posts
47-
left_join(:posts, user_id: :id)
47+
left_join(:posts, id: :user_id)
4848
end
4949
end
5050
```
@@ -63,11 +63,11 @@ class Users < ROM::Relation[:sql]
6363
end
6464

6565
def with_tasks
66-
join(:tasks, { user_id: :id }, table_alias: :user_tasks)
66+
join(:tasks, { id: :user_id }, table_alias: :user_tasks)
6767
end
6868

6969
def with_posts
70-
left_join(posts, { user_id: :id }, table_alias: :user_posts)
70+
left_join(posts, { id: :user_id }, table_alias: :user_posts)
7171
end
7272
end
7373
```

0 commit comments

Comments
 (0)