class ActiveRecord::Base

Public Class Methods

acts_as_paranoid() click to toggle source
# 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
paranoid?() click to toggle source
# File lib/paranoia.rb, line 45
def self.paranoid? ; false ; end

Public Instance Methods

paranoid?() click to toggle source
# File lib/paranoia.rb, line 46
def paranoid? ; self.class.paranoid? ; end
persisted?() click to toggle source

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”.

Calls superclass method
# File lib/paranoia.rb, line 51
def persisted?
  paranoid? ? !new_record? : super
end