Module: Archivist::Base::InstanceMethods

Defined in:
lib/archivist/base.rb

Overview

these defs can’t happen untill after we’ve aliased their respective originals

Instance Method Summary collapse

Instance Method Details

#deleteObject



142
143
144
145
146
147
# File 'lib/archivist/base.rb', line 142

def delete
  result = self.copy_self_to_archive unless new_record?
  self.delete! if result
  @destroyed = true
  freeze
end

#destroyObject



149
150
151
152
153
# File 'lib/archivist/base.rb', line 149

def destroy
  _run_destroy_callbacks do
    self.delete
  end
end

#destroy!Object



155
156
157
158
159
160
161
# File 'lib/archivist/base.rb', line 155

def destroy!
  transaction do
    _run_destroy_callbacks do
      self.delete!
    end
  end
end