# File lib/paranoia.rb, line 38 def self.acts_as_paranoid alias :destroy! :destroy alias :delete! :delete include Paranoia default_scope { where(:deleted_at => nil) } end
# File lib/paranoia.rb, line 45 def self.paranoid? ; false ; end
# File lib/paranoia.rb, line 46 def paranoid? ; self.class.paranoid? ; end
Override the persisted method to allow for the paranoia gem. If a paranoid record is selected, then we only want to check if it's a new record, not if it is “destroyed”.
# File lib/paranoia.rb, line 51 def persisted? paranoid? ? !new_record? : super end