This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
commit 754a1b12006a8236879f99cfde9e72724b55573e
tree df2aa76cab8f3c0dfbc547180e132ed93b57deeb
parent 61cc54c75b0c9cf3e44e83a1ea864532d298fc78
tree df2aa76cab8f3c0dfbc547180e132ed93b57deeb
parent 61cc54c75b0c9cf3e44e83a1ea864532d298fc78
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Thu Jan 31 10:19:07 -0800 2008 | |
| |
Manifest.txt | Thu Mar 19 13:05:40 -0700 2009 | |
| |
README | Thu Jan 31 10:19:07 -0800 2008 | |
| |
Rakefile | Sat Sep 26 15:56:40 -0700 2009 | |
| |
VERSION | Sun Sep 27 00:08:13 -0700 2009 | |
| |
init.rb | Sun Sep 27 00:08:03 -0700 2009 | |
| |
install.rb | Thu Jan 31 10:19:07 -0800 2008 | |
| |
lib/ | Sun Sep 27 00:08:03 -0700 2009 | |
| |
permanent_records.gemspec | Sun Sep 27 00:02:55 -0700 2009 | |
| |
tasks/ | Thu Jan 31 10:19:07 -0800 2008 | |
| |
test/ | Sun Sep 27 00:02:11 -0700 2009 | |
| |
uninstall.rb | Thu Jan 31 10:19:07 -0800 2008 |
README
PermanentRecords
================
This plugin prevents any of your records from being destroyed casually.
Any model with a deleted_at datetime column will have that column set rather than being deleted.
Usage
=======
User.find(3).destroy # sets the 'deleted_at' attribute to Time.now and returns a frozen record
User.find(3).destroy(:force) # executes the real destroy method, the record will be removed from the database
User.delete_all # bye bye everything
There are also two named scopes provided for easily searching deleted and not deleted records:
User.send :with_deleted { User.find(:all) } # only returns deleted records.
User.send :with_not_deleted { User.find(:all) } # you guessed it.
These are named so as to work smoothly with other scoping plugins like scope_out.
Copyright (c) 2008 Jack Danger Canty of adPickles Inc., released under the MIT license







