mirror of
https://github.com/affaan-m/ECC.git
synced 2026-09-18 15:50:25 +02:00
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:
@@ -359,6 +359,7 @@
|
||||
],
|
||||
"rules": ["common"],
|
||||
"skills": [
|
||||
"rails-patterns",
|
||||
"tdd-workflow",
|
||||
"verification-loop"
|
||||
],
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user