Commit 910fed4
Add complete Rails 8.1.1 support
Rails 8.1 introduced several breaking changes that required updates
across routing, testing, and SQL generation:
Routing changes (lib/jsonapi/routing_ext.rb):
- Rails 8.1 changed Scope to not support []= operator
- Resource.new signature changed (removed options parameter)
- Solution: Use @jsonapi_resource_type instance variable to track
resource type instead of @scope[:jsonapi_resource]
- Updated resource_type_with_module_prefix to check instance variable
- Maintains backward compatibility with Rails 4-8.0
Test compatibility (test/integration/requests/request_test.rb):
- Rails 8.1 has more detailed JSON parse error messages
- Updated test_put_invalid_json to accept multiple error formats
- Now matches: "unexpected token at" OR "expected ... got:" OR "parse error"
SQLite boolean representation (test/unit/active_relation_resource_finder/join_manager_test.rb):
- Rails 8.1+ SQLite now uses TRUE instead of 1 for boolean values
- Updated db_true helper with version check for Rails 8.1+
- Maintains support for older Rails versions (5.x-8.0)
Test results:
- Rails 6.1.7.10: 674/674 tests passing ✓
- Rails 7.0.10: 674/674 tests passing ✓
- Rails 7.1.6: 674/674 tests passing ✓
- Rails 7.2.3: 674/674 tests passing ✓
- Rails 8.0.4: 674/674 tests passing ✓
- Rails 8.1.1: 674/674 tests passing ✓
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent a873454 commit 910fed4
File tree
3 files changed
+31
-17
lines changed- lib/jsonapi
- test
- integration/requests
- unit/active_relation_resource_finder
3 files changed
+31
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | | - | |
| 68 | + | |
67 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| |||
130 | 135 | | |
131 | 136 | | |
132 | 137 | | |
133 | | - | |
| 138 | + | |
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
140 | 145 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
146 | 153 | | |
147 | | - | |
| 154 | + | |
148 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
149 | 159 | | |
150 | 160 | | |
151 | 161 | | |
| |||
291 | 301 | | |
292 | 302 | | |
293 | 303 | | |
294 | | - | |
| 304 | + | |
295 | 305 | | |
296 | 306 | | |
297 | 307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
581 | | - | |
| 581 | + | |
| 582 | + | |
582 | 583 | | |
583 | 584 | | |
584 | 585 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
0 commit comments