Skip to content

Commit d78a563

Browse files
authored
Merge pull request #398 from mgiagante/patch-1
Fixes column order for ROM::SQL::Relation::Reading #join
2 parents 374e47b + d2386f7 commit d78a563

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)