12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/rollgeist/patches/persistence.rb', line 12
def destroy(...)
return super unless defined?(@__rollgeist_mark)
Rollgeist::Notifier.notify(self, :resave)
mark = instance_variable_get(MARK_IVAR)
reported = instance_variable_get(REPORTED_IVAR) if instance_variable_defined?(REPORTED_IVAR)
Rollgeist.clear_mark!(self)
result = super
restore_mark(mark, reported) unless result
result
rescue Exception restore_mark(mark, reported) if mark && !frozen?
raise
end
|