Module: DataMapper::Types::Paranoid::Base

Defined in:
lib/dm-types/paranoid/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(model) ⇒ Object



5
6
7
8
# File 'lib/dm-types/paranoid/base.rb', line 5

def self.included(model)
  model.extend ClassMethods
  model.instance_variable_set(:@paranoid_properties, {})
end

Instance Method Details

#paranoid_destroyObject



10
11
12
13
14
15
16
17
# File 'lib/dm-types/paranoid/base.rb', line 10

def paranoid_destroy
  model.paranoid_properties.each do |name, block|
    attribute_set(name, block.call(self))
  end
  save_self
  self.persistence_state = Resource::PersistenceState::Immutable.new(self)
  true
end