0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
flag database records as deleted and hide them from subsequent queries
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0.9.2.2
>= 3.5
~> 1.3.2

Runtime

>= 4.2.7.1
 Project Readme

Build Status

delete_paranoid

Soft Delete ActiveRecord instances.

Usage

class Blog < ActiveRecord::Base
  acts_as_paranoid
end
blog = Blog.create! :name => 'foo'

# soft delete the instance
blog.destroy

# query database for results *including* soft deleted objects
Blog.with_deleted do
  Blog.all
end

# permenantly delete the instance from the database
Blog.delete! blog.id

Features

  • simple configuration
  • preserves existing ActiveRecord API. No magical new API's to use when you want to soft delete a record
  • automatically exclude soft deleted records from database queries (by default)
  • support for querying database for all records (including soft deleted ones)
  • support for permenantly deleting record from database

Contributing

  • Fork the project
  • Fix the issue
  • Add tests
  • Submit a pull request on github

see CONTRIBUTORS.txt for complete list of contributors

Copyright

Copyright (c) 2011 Socialcast Inc. See LICENSE.txt for further details.