-
-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Labels
Milestone
Description
Phase 1 — Modernization Target #2
Add reusable, composable query fragments defined in the model via a scope() config method.
Design
// Model config()
scope(name="active", where="status = 'active'");
scope(name="recent", order="createdAt DESC", maxRows=10);
scope(name="byRole", handler="scopeByRole");
// Usage — composable
model("User").active().recent().findAll();
model("User").byRole("admin").findAll(page=1, perPage=25);- Store scope definitions in
variables.wheels.class.scopes - Use
onMissingMethodto intercept scope calls and build a query spec chain - Modify
findAll(),findOne(),findByKey()to accept and merge query spec structs - Return a
ScopeChainproxy object from scope calls
Backwards Compatibility
All existing findAll(where="...") calls work unchanged. Scopes are purely additive.
See design_docs/MODERNIZE-WHEELS-RIM.md §4.2 for full implementation plan.
Reactions are currently unavailable