guard_against_physical_delete is monkey patch for ActiveRecord. This patch prevent deleting record physically.
Ruby
Pull request Compare This branch is 44 commits behind cookpad:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.gitignore
Gemfile
Gemfile.lock
License.txt
README.rdoc
Rakefile
VERSION
guard_against_physical_delete.gemspec

README.rdoc

guard_against_physical_delete

guard_against_physical_delete is monkey patch for ActiveRecord. This patch prevent deleting record physically. set logical delete column name. (default is :deleted_at)

Logical.logical_delete_column = :removed_at
Logical.first.delete #=> raise GuardAgainstPhysicalDelete::PhysicalDeleteError
Logical.physical_delete { Logical.first.delete } #=> allow physical_delete

Copyright

Copyright © 2012 morita shingo. See License.txt fo further details.