module OnDestroy::Model::ClassMethods

Public Instance Methods

on_destroy(*args) click to toggle source

a shortcut to set configuration: self.do_not_delete, self.set, self.to, self.is_deleted_if and to default self.is_deleted_if to a proc that

# File lib/on_destroy/model.rb, line 17
def on_destroy(*args)
  options = args.extract_options!
  self.do_not_delete = args.include?(:do_not_delete)
  self.on_destroy_options = options
end