Module: VestalVersions::Deletion

Defined in:
lib/vestal_versions/deletion.rb

Overview

Allows version creation to occur conditionally based on given :if and/or :unless options.

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/vestal_versions/deletion.rb', line 5

def self.included(base) # :nodoc:
  base.class_eval do
    extend ClassMethods
    include InstanceMethods

    before_destroy :create_destroyed_version, :if => :delete_version?

    class << self
      alias_method_chain :prepare_versioned_options, :deletion
    end
  end
end