talira

Compare

DiscardParanoia
What it isSoft deletes for ActiveRecord done rightacts_as_paranoid for Rails 5, 6 and 7
KindOpen sourceOpen source
Trust0.280.32
Stars——
Last commit——
LicenceMITMIT-Modern-Variant
PricingFree and open sourceFree and open source
Free tierYesYes
Self-hostableYesYes
Ways to run it——
SOC 2——
HIPAA——
SSO——
APIYesYes
Plugins——
MCP server——
Company—Ruby Sherpas
Features
  • discard, discard!, undiscard and undiscard! on records
  • discard_all and undiscard_all on scopes
  • kept, undiscarded, discarded and with_discarded scopes
  • discarded?, undiscarded? and kept? predicates
  • before, after and around discard and undiscard callbacks
  • discard and undiscard run in a transaction, so a callback error rolls back
  • custom column name (keep deleted_at from paranoia)
  • no overridden Active Record methods and no default scope
  • destroy sets deleted_at; a default scope hides deleted rows
  • with_deleted, without_deleted and only_deleted scopes
  • restore, recursive restore and a recovery window
  • really_destroy! for permanent deletes
  • soft-deletes dependent: :destroy associations
  • custom column name and an option to skip the default scope
  • after_restore_commit callback
  • association_not_soft_destroyed validator
Limitations
  • Doesn't discard associated records recursively: there's no dependent: :destroy equivalent, so you use scopes or callbacks
  • Doesn't restore associated records recursively
  • Doesn't adjust counter cache columns: counts include discarded records
  • Not recommended for new projects by its maintainers: it overrides Active Record's delete and destroy, and they point to discard
  • Doesn't take new features: it gets bug fixes and support for new Rails versions only