module Undeletable

Constants

VERSION

Attributes

debug[RW]

Public Class Methods

configure(&blk) click to toggle source
# File lib/undeletable.rb, line 6
def configure(&blk)
  class_eval(&blk)
end

Public Instance Methods

delete() click to toggle source
# File lib/undeletable.rb, line 39
def delete
  raise ActiveRecord::ReadOnlyRecord.new("#{self} is undeletable") if raise_on_delete?
  logger.debug("will not delete #{self}", e) if Undeletable.debug
end
destroy() click to toggle source
# File lib/undeletable.rb, line 33
def destroy
  raise ActiveRecord::ReadOnlyRecord.new("#{self} is undeletable") if raise_on_delete?
  logger.debug("will not delete #{self}", e) if Undeletable.debug
  run_callbacks(:destroy) { delete }
end