When you destroy an activerecord object that uses acts_as_paranoid, the record is flagged instead of actually deleted. You can then look at the database and review those deleted items. Combined with acts_as_audited you get an interesting audit trail.
acts_as_paranoid monkeys with AR to pull this off. Unfortunately there are times when cracks show through.
- When you call find, do not use :include to join in a paranoid model unless you make arrangements to drop out deleted records
- If you want to use a :through relation with a paranoid model, you must add a clause to drop deleted records.
has_many :movies, :through => :dancer_movies, :conditions => ['dancer_movies.deleted_at is null']
I'll add more as I discover them.
No comments:
Post a Comment