Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Find deleted associations which act as paranoid
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
LICENSE
README.textile
init.rb

README.textile

May Be Deleted

This plugin is meant to be used in conjuction with acts_as_paranoid.

Requirement

Finding deleted has_one and belongs_to associative records, which have been deleted via acts_as_paranoid.

Usage

To show the author_name of an article, whose author has been deleted:

@article.force_find("author").name

assuming that article belongs_to author

belongs_to :author, class_name => "User"

Example Usage

Consider a case of an application where a user(“Bob”) has created a note. Bob has left the organization and is “deleted” from the system. However the note created by Bob is not deleted. When rendering the note, the name of the creator => “Bob” needs to be displayed, even though he is “deleted” from the system.

A better use is explained in this blog article.

Copyright © 2009 Udit Sajjanhar, Intinno Technologies Pvt. Ltd.

Something went wrong with that request. Please try again.