Skip to content

intinno/may_be_deleted

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Find deleted associations which act as paranoid

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages