Skip to content

Commit 8707eac

Browse files
committed
WIP: Adds #only_active scope
1 parent bc515d1 commit 8707eac

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/paranoia.rb

Lines changed: 4 additions & 0 deletions
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 only_active
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)