guard_against_physical_delete is monkey patch for ActiveRecord. This patch prevent deleting record physically.
Ruby
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.travis.yml
Gemfile
License.txt
README.rdoc
Rakefile
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

Support

active_record 3.0.10, >= 3.2

Copyright

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