Module: OnDestroy::Model::ClassMethods

Defined in:
lib/on_destroy/model.rb

Instance Method Summary collapse

Instance Method Details

#on_destroy(*args) ⇒ Object

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



17
18
19
20
21
# 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