grosser/soft_deletion — pull request #10 by petermin (2013-04-23 22:20:07+00:00)
Title: Adds Rails 3 ActiveRecord::Relation methods #with_deleted and #only_deleted

This supplements the existing SoftDeletion::Core#with_deleted method that extends ActiveRecord::Base.

The new methods SoftDeletion::Relation#with_deleted and #only_deleted can be chained in Arel queries, for example, User.approved.with_deleted.all.

They are especially useful when using SoftDeletion with the default_scope option set to true because the default_scope is re-applied if there's any scope inside the SoftDeletion::Core#with_deleted block, i.e. User.with_deleted { User.approved.all } -- in which case none of the deleted and approved users is returned.