acts as soft deletable plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install http://github.com/ajh/acts_as_soft_deletable/tree/master
class Artist < ActiveRecord::Base
acts_as_soft_deletable # This will wrap the destroy method to provide soft delete # support and create a new ActiveRecord class called Artist::Deleted end
model = Artist.find(34) model.destroy # removes row from artists table, and adds a row to # deleted_artists table
deleted = Artist::Deleted.find(34) deleted.undestroy! # adds the row back to the artists table, and removes # if from the deleted_artists table
restored = Artist.find(34) # The artist is restored with all the same # information. The updated_at column will be # Time.now if it exists.
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | Back in time (1 older version) | Last edited by: scott, 6 months ago

