Method: Ardm::Property::ParanoidBase#destroy

Defined in:
lib/ardm/property/support/paranoid_base.rb

#destroy(execute_hooks = true) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ardm/property/support/paranoid_base.rb', line 23

def destroy(execute_hooks = true)
  # NOTE: changed behavior because AR doesn't call hooks on destroying new objects
  return false if new_record?
  if execute_hooks
    run_callbacks :destroy do
      paranoid_destroy
    end
  else
    super
  end
end