Module: SoftDeletable::InstanceMethods

Defined in:
lib/soft_deletable.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/soft_deletable.rb', line 13

def destroy
  if persisted?
    with_transaction_returning_status do
      _run_destroy_callbacks do
        self.class.unscoped.update_all({:deleted_at => Time.now.utc}, {:id => self.id})
      end
    end
  end

  @destroyed = true
  freeze
end