Module Cms::Behaviors::SoftDeleting::InstanceMethods
In: lib/cms/behaviors/soft_deleting.rb

Methods

Public Instance methods

[Source]

    # File lib/cms/behaviors/soft_deleting.rb, line 67
67:         def destroy!
68:           transaction { destroy_with_callbacks! }
69:         end

[Source]

    # 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

[Source]

    # 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

[Source]

    # File lib/cms/behaviors/soft_deleting.rb, line 71
71:         def destroyed?
72:           @destroyed
73:         end

[Source]

    # File lib/cms/behaviors/soft_deleting.rb, line 55
55:         def mark_as_deleted!
56:           destroy_without_callbacks
57:         end

[Validate]