heartcombo/has_scope
Map incoming controller parameters to named scopes in your resources observed · 2026-08-28
Health v2 · maintenance only
60/100
- Activity 74
- Release rhythm 18
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 6116
- days_rel: 334
- days_push: 159
- n_releases_24m: 1
Adoption not part of the score
1728 stars · 92 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
HasScope is a Ruby gem that dynamically applies ActiveRecord named scopes to resources based on incoming controller parameters. It is most commonly used in Rails controllers to map request query parameters to safe, whitelisted scope-based filtering of records.
Use cases
- filter Rails index listings by query params like ?featured=true
- map incoming controller parameters to named scopes safely
- build filterable resource endpoints without manual param parsing
- restrict which scopes a controller action may apply
- inspect currently applied scopes in controllers or views
- apply scopes to resources outside of controllers
When to choose
- you have a Rails or Ruby app using ActiveRecord named scopes
- you want declarative, whitelisted param-to-scope filtering
- you need type coercion for boolean or hash scope parameters
When to avoid
- you don't use ActiveRecord or named scopes
- you need complex filtering logic beyond simple scope mapping
- you're not on a Ruby/Rails stack
Facets
library · maturity stable
middleware routing database web-development backend developer-tools ruby rails active-record named-scopes filtering query-parameters gem web-server
1 source
- readme: https://github.com/heartcombo/has_scope · fetched 2026-08-28 · c94cbd667c2b
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| heartcombo/has_scope | main | 60 |
For agents
markdown · JSON · MCP: product_card(name="heartcombo/has_scope")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem