Commit 47275d2
committed
feat(ogar-from-ruff): prove emit_rust on a Rails-lifted CompiledClass
Step 2 of the gating order in the OP+Redmine convergence handover
(openproject-nexgen-rs .claude/handovers/2026-06-30-1200-...md §4): before
this commit, emit_rust/csharp/python had only ever run on an Odoo-lifted
CompiledClass (compile_graph_python, in emit.rs's own tests). This adds
a Rails fixture (compile_graph_ruby::<OpenProjectPort> on a WorkPackage
graph with a typed attribute, an untyped attribute, a belongs_to with a
class_name override, and a has_many) and asserts emit_rust renders it
correctly — closing the "pull-back codegen leg unproven on Rails" gap
named in the handover's risk list. Fully offline, OGAR-only — no
openproject-nexgen-rs change.
Found and fixed a real (if narrow) bug along the way: screaming_snake()
only split on '.'/'_', so it silently produced WORKPACKAGE_CLASSID
instead of WORK_PACKAGE_CLASSID for any already-PascalCase Rails class
name (Rails class names carry no separator at all — Odoo's underscored
names happened to mask this). Fixed to also split on a lower->upper case
transition; added a direct unit test
(screaming_snake_splits_bare_pascal_case_rails_names) covering
WorkPackage/TimeEntry/Project plus the original dotted-Odoo-name case.
Verification: standalone probe workspace (same as the rest of this PR).
46/46 tests pass (2 new). clippy -D warnings clean, both --no-deps and
full workspace, at the pinned 1.95.0 toolchain. cargo fmt --check clean
for the lines this commit touches (the crate carries pre-existing,
unrelated fmt drift from never being cargo-fmt-gated — same root cause
as the clippy debt fixed earlier in this PR; left untouched, out of
scope here).1 parent 8508a49 commit 47275d2
2 files changed
Lines changed: 117 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
327 | 335 | | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
333 | 353 | | |
334 | 354 | | |
335 | 355 | | |
336 | 356 | | |
337 | 357 | | |
338 | 358 | | |
339 | 359 | | |
340 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
341 | 363 | | |
342 | 364 | | |
343 | 365 | | |
| |||
420 | 442 | | |
421 | 443 | | |
422 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
423 | 518 | | |
424 | 519 | | |
425 | 520 | | |
| |||
536 | 631 | | |
537 | 632 | | |
538 | 633 | | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
539 | 647 | | |
540 | 648 | | |
541 | 649 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | 139 | | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
| 304 | + | |
309 | 305 | | |
310 | 306 | | |
311 | 307 | | |
| |||
0 commit comments