Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 386cacd

Browse files
committedJun 8, 2015
WIP: Adds #without_deleted scope
1 parent bc515d1 commit 386cacd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎lib/paranoia.rb

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ def only_deleted
3333
end
3434
alias :deleted :only_deleted
3535

36+
def without_deleted
37+
where(paranoia_column => nil)
38+
end
39+
3640
def restore(id_or_ids, opts = {})
3741
ids = Array(id_or_ids).flatten
3842
any_object_instead_of_id = ids.any? { |id| ActiveRecord::Base === id }

0 commit comments

Comments
 (0)