| Module | Cms::Behaviors::SoftDeleting::InstanceMethods |
| In: |
lib/cms/behaviors/soft_deleting.rb
|
# File lib/cms/behaviors/soft_deleting.rb, line 67
67: def destroy!
68: transaction { destroy_with_callbacks! }
69: end
# File lib/cms/behaviors/soft_deleting.rb, line 59
59: def destroy_with_callbacks!
60: return false if callback(:before_destroy) == false
61: result = destroy_without_callbacks!
62: @destroyed = true
63: callback(:after_destroy)
64: result
65: end
Overrides original destroy method
# File lib/cms/behaviors/soft_deleting.rb, line 47
47: def destroy_without_callbacks
48: if self.class.publishable?
49: update_attributes(:deleted => true, :publish_on_save => true)
50: else
51: update_attributes(:deleted => true)
52: end
53: end