Skip to content

Commit

Permalink
WIP: Adds #without_deleted scope
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesfostie committed Jun 8, 2015
1 parent bc515d1 commit 386cacd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/paranoia.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def only_deleted
end
alias :deleted :only_deleted

def without_deleted
where(paranoia_column => nil)
end

def restore(id_or_ids, opts = {})
ids = Array(id_or_ids).flatten
any_object_instead_of_id = ids.any? { |id| ActiveRecord::Base === id }
Expand Down

0 comments on commit 386cacd

Please sign in to comment.