Fix/rails patterns followups

Independent local Codex review PASS at a6a6419402, no P0/P1. Independent 181 checks and strict skill validation pass. CI run 34667546951 passed, all 45 current checks green. Existing Rails skill mapping and documentation corrections only. Rollback: revert this squash commit.
This commit is contained in:
Rockwell Windsor Rice
2026-09-12 04:39:08 -04:00
committed by GitHub
parent ab1f1a09ba
commit b6ddd13a9f
2 changed files with 3 additions and 3 deletions
+1
View File
@@ -359,6 +359,7 @@
],
"rules": ["common"],
"skills": [
"rails-patterns",
"tdd-workflow",
"verification-loop"
],
+2 -3
View File
@@ -163,8 +163,8 @@ module Invoices
def build_invoice
invoice = user.invoices.new(params.except(:line_items))
invoice.tax_total = TaxCalculator.call(invoice)
invoice.line_items.build(params[:line_items])
invoice.tax_total = TaxCalculator.call(invoice)
invoice.total = invoice.line_items.sum(&:amount) + invoice.tax_total
invoice
end
@@ -258,7 +258,7 @@ Query objects accept a scope, so they compose: `Invoices::Overdue.call(scope: cu
@posts = Post.published.includes(:author)
```
`includes` lets Rails choose preload vs eager_load. Force `preload` for separate queries, `eager_load` for a JOIN when filtering on the association. In Rails 7.1+, `strict_loading` raises on accidental lazy loads.
`includes` lets Rails choose preload vs eager_load. Force `preload` for separate queries, `eager_load` for a JOIN when filtering on the association. Since Rails 6.1, `strict_loading` raises on accidental lazy loads.
### Counter cache
@@ -472,5 +472,4 @@ If the page is server-rendered with occasional interactivity, Hotwire ships fast
## Related Skills
- `backend-patterns` — service boundaries and adapter patterns (referenced by the Ruby patterns rules)
- `ruby-patterns` — language-level Ruby idioms (if present)
- Ruby patterns rules (`rules/ruby/patterns.md`, installed as `rules/ecc/ruby/patterns.md`) — the decisions and when-to-use guidance this skill implements