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 (
Run the following if you haven't already:
gem sources -a http://gems.github.com
Install the gem(s):
sudo gem install ryanlowe-acts_as_indestructible
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Sun May 25 16:51:02 -0700 2008 | [ryanlowe] |
| |
CHANGELOG | Mon May 26 10:28:05 -0700 2008 | [ryanlowe] |
| |
MIT-LICENSE | Thu May 22 00:25:40 -0700 2008 | [ryanlowe] |
| |
README | Sun May 25 16:51:02 -0700 2008 | [ryanlowe] |
| |
Rakefile | Thu May 01 20:43:09 -0700 2008 | [ryanlowe] |
| |
TODO | Mon May 26 10:26:41 -0700 2008 | [ryanlowe] |
| |
acts_as_indestructible.gemspec | Mon May 26 10:28:05 -0700 2008 | [ryanlowe] |
| |
app/ | Thu May 15 17:54:19 -0700 2008 | [ryanlowe] |
| |
config/ | Thu May 01 20:43:09 -0700 2008 | [ryanlowe] |
| |
db/ | Thu May 22 00:25:40 -0700 2008 | [ryanlowe] |
| |
init.rb | Fri May 23 19:28:38 -0700 2008 | [ryanlowe] |
| |
lib/ | Fri May 23 19:42:44 -0700 2008 | [ryanlowe] |
| |
script/ | Thu May 01 20:43:09 -0700 2008 | [ryanlowe] |
| |
test/ | Mon May 26 10:26:41 -0700 2008 | [ryanlowe] |
README
IMPORTANT: This plugin is a work in progress and should not be used in production
yet. Feel free to fork on GitHub and send patches.
If you would like to see your patch in this Git repository it must be tested.
If you find a bug, a test exposing the bug would be great.
= acts_as_indestructible
acts_as_indestructible aims to be an alternate version
of the acts_as_paranoid plugin idea, which is to mark ActiveRecord objects
as destroyed instead of actually deleting them from the database.
After an object is marked as destroyed it should be excluded from
all of the ActiveRecord method calls and act as if it
was deleted from the database.
= Differences from acts_as_paranoid
1. acts_as_indestructible fills the destroyed_at field as well
as destroyed_by
2. destroy() and destroy_all(conditions=nil) have a
user parameter, making them destroy(user) and
destroy_all(user,conditions=nil). The user
parameter is an ActiveRecord user object and
the user.id is stored in the destroyed_by column.
3. acts_as_paranoid overrides protected and private
ActiveRecord::Base methods which could change at any time.
acts_as_indestructible will work to provide the
same function while using the public API contract that
will not change within major Rails versions.
4. delete() and delete_all() throw exceptions and are effectively
deprecated, which prevents developers from permanently deleting
objects this way. Raw SQL could still delete objects permanently.
= API changes from ActiveRecord::Base
destroy(user)
destroy_all(user, conditions = nil)
exists?(id_or_conditions, options = {})
DEPRECATED:
ActiveRecord::Base.delete(id)
ActiveRecord::Base.delete_all
= Major plugin goals
- test all corner cases of the ActiveRecord methods affected by this plugin
- not impact performance, when possible
- play well with other major plugins
Also see TODO for specific things left to do




