# jhawthorn/discard

🃏🗑 Soft deletes for ActiveRecord done right

Repository: https://github.com/jhawthorn/discard
Canonical: https://ross.abutalabs.com/products/discard
Language: Ruby
License: MIT
License Family: permissive
Last push: 2026-06-22T20:32:26+00:00

## Health v2 (maintenance only)
Score: 72/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 88, release rhythm 35, longevity 100
- inputs: {"age_days": 3424, "days_push": 72, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2424, forks 96 (observed 2026-08-28T04:06:50.721181+00:00)

## What it is
Discard is a simple Ruby ActiveRecord mixin that adds soft-delete conventions by flagging records with a discarded_at timestamp instead of destroying them. It provides kept/discarded scopes and discard/undiscard methods as a lightweight alternative to gems like paranoia.

## Use cases
- soft delete records in a Rails app
- restore deleted records with undiscard
- replace acts_as_paranoid with a simpler soft-delete mixin
- keep deleted posts out of default queries but still queryable
- implement trash/undo functionality in ActiveRecord models

## When to choose
- you use ActiveRecord and want simple, minimal soft deletes
- you want discarded records to remain queryable without cascading deletes to associations
- you find paranoia too invasive or awkward for restoring records

## When to avoid
- you need hard deletes with true row removal
- you're not using Rails/ActiveRecord
- you need versioned audit trails or full history tracking rather than a single discarded_at flag

## Facets
- artifact type: library
- maturity: stable
- function: orm, database, developer-tools
- domain: web-development, databases, backend
- platform: ruby, jvm
- tags: soft-deletes, activerecord, rails, ruby-gem

## Member repositories
- jhawthorn/discard (main) score 72

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:50.721181+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:31:51.126866+00:00, confidence not recorded.
  - readme: https://github.com/jhawthorn/discard (fetched 2026-08-28T04:06:50.721181+00:00, sha f9d41c8bcb48)
- Data as of 2026-08-30T08:39:29.467469+00:00.
