Commit e92afc6
authored
Fix include_optional_linkage_data with joins (#1450)
When the user adds a join in `records`, it confuses `get_join_arel_node`
because it finds the same number of joins before & after adding a join
for `include_optional_linkage_data` (or equivalently for
`always_include_*_linkage_data`).
This commit falls back to searching the existing arel nodes for a
compatible join and uses that if found.1 parent a3a2a7a commit e92afc6
File tree
4 files changed
+42
-4
lines changed- lib/jsonapi/active_relation
- test
- fixtures
- integration/requests
4 files changed
+42
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
83 | 102 | | |
84 | 103 | | |
85 | | - | |
86 | 104 | | |
87 | 105 | | |
88 | 106 | | |
| |||
154 | 172 | | |
155 | 173 | | |
156 | 174 | | |
157 | | - | |
| 175 | + | |
158 | 176 | | |
159 | 177 | | |
160 | 178 | | |
| |||
294 | 312 | | |
295 | 313 | | |
296 | 314 | | |
297 | | - | |
| 315 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1059 | 1059 | | |
1060 | 1060 | | |
1061 | 1061 | | |
| 1062 | + | |
| 1063 | + | |
1062 | 1064 | | |
1063 | 1065 | | |
1064 | 1066 | | |
| |||
2042 | 2044 | | |
2043 | 2045 | | |
2044 | 2046 | | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
2045 | 2056 | | |
2046 | 2057 | | |
2047 | 2058 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1855 | 1855 | | |
1856 | 1856 | | |
1857 | 1857 | | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
1858 | 1864 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
315 | 318 | | |
316 | 319 | | |
317 | 320 | | |
| |||
0 commit comments