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 (
studioda (author)
Mon Feb 18 12:38:57 -0800 2008
commit fb19a7c1cc6f1a38c7a6a15cf4b8ca36768a7b19
tree 4a45519f35647da22b37eaaabaf52a7fe0938dfd
parent 61068bacf4a1ab4db70cb749b3a14efe3847b0d2
tree 4a45519f35647da22b37eaaabaf52a7fe0938dfd
parent 61068bacf4a1ab4db70cb749b3a14efe3847b0d2
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Thu Jan 31 10:19:07 -0800 2008 | [studioda] |
| |
README | Thu Jan 31 10:19:07 -0800 2008 | [studioda] |
| |
Rakefile | Thu Jan 31 10:19:07 -0800 2008 | [studioda] |
| |
init.rb | Thu Jan 31 10:19:07 -0800 2008 | [studioda] |
| |
install.rb | Thu Jan 31 10:19:07 -0800 2008 | [studioda] |
| |
lib/ | Mon Feb 18 12:38:57 -0800 2008 | [studioda] |
| |
tasks/ | Thu Jan 31 10:19:07 -0800 2008 | [studioda] |
| |
test/ | Mon Feb 18 12:38:57 -0800 2008 | [studioda] |
| |
uninstall.rb | Thu Jan 31 10:19:07 -0800 2008 | [studioda] |
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




