Commit 2489be0
Complete Rails 7.2.3 support
Add full Rails 7.2 compatibility while maintaining backward compatibility
with Rails 6.1, 7.0, and 7.1.
Key Changes:
1. Deprecation API Updates (Rails 7.2 made methods private):
- Add JSONAPI.warn_deprecated() helper method
- Replace all ActiveSupport::Deprecation.warn calls
- Handle ActiveSupport::Deprecation.silenced= conditionally in tests
- Falls back to Kernel#warn with [DEPRECATION] prefix for Rails 7.2+
2. Configuration Initialization Fix:
- Change from attr_accessor to custom getter method
- Ensures @configuration ||= Configuration.new works reliably
- Fixed "undefined method for nil" errors in 304 tests
3. Test Fixture Path Changes:
- Rails 7.2 changed fixture_path= to fixture_paths= (array)
- Add conditional handling in three test classes:
* Minitest::Test
* ActiveSupport::TestCase
* ActionDispatch::IntegrationTest
4. Test Helper Deprecation Silencing:
- Update test_helper.rb to handle Rails 7.2 deprecators API
- Conditional logic for silencing deprecation warnings
Files Modified:
- lib/jsonapi/configuration.rb: Added warn_deprecated helper + fixed getter
- lib/jsonapi/basic_resource.rb: Use JSONAPI.warn_deprecated
- lib/jsonapi/acts_as_resource_controller.rb: Use JSONAPI.warn_deprecated
- lib/jsonapi/relationship.rb: Use JSONAPI.warn_deprecated
- test/test_helper.rb: Fixture paths + deprecation silencing
- test/unit/resource/resource_test.rb: Conditional silenced= handling
- test/integration/requests/request_test.rb: Conditional silenced= handling
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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 5e53504 commit 2489be0
File tree
9 files changed
+77
-29
lines changed- lib/jsonapi
- test
- integration/requests
- unit/resource
9 files changed
+77
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
| 66 | + | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
| 74 | + | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | | - | |
| 550 | + | |
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
| |||
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
318 | | - | |
| 317 | + | |
319 | 318 | | |
320 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
321 | 323 | | |
322 | 324 | | |
323 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
324 | 340 | | |
325 | 341 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1367 | 1367 | | |
1368 | 1368 | | |
1369 | 1369 | | |
1370 | | - | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
1371 | 1374 | | |
1372 | 1375 | | |
1373 | 1376 | | |
1374 | 1377 | | |
1375 | 1378 | | |
1376 | 1379 | | |
1377 | | - | |
| 1380 | + | |
1378 | 1381 | | |
1379 | 1382 | | |
1380 | | - | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
1381 | 1386 | | |
1382 | 1387 | | |
1383 | 1388 | | |
| |||
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
| |||
503 | 510 | | |
504 | 511 | | |
505 | 512 | | |
506 | | - | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
507 | 519 | | |
508 | 520 | | |
509 | 521 | | |
510 | 522 | | |
511 | | - | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
512 | 529 | | |
513 | 530 | | |
514 | 531 | | |
515 | 532 | | |
516 | 533 | | |
517 | 534 | | |
518 | 535 | | |
519 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
520 | 542 | | |
521 | 543 | | |
522 | 544 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
438 | 441 | | |
439 | 442 | | |
440 | 443 | | |
441 | 444 | | |
442 | 445 | | |
443 | 446 | | |
444 | 447 | | |
445 | | - | |
| 448 | + | |
446 | 449 | | |
447 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
448 | 453 | | |
449 | 454 | | |
450 | 455 | | |
| |||
0 commit comments