Module: VestalVersions::Deletion::ClassMethods

Defined in:
lib/vestal_versions/deletion.rb

Overview

Class methods on ActiveRecord::Base

Instance Method Summary collapse

Instance Method Details

#prepare_versioned_options(options) ⇒ Object

After the original prepare_versioned_options method cleans the given options, this alias also extracts the :depedent if it set to :tracking



15
16
17
18
19
20
21
22
23
# File 'lib/vestal_versions/deletion.rb', line 15

def prepare_versioned_options(options)
  result = super(options)
  if result[:dependent] == :tracking
    self.vestal_versions_options[:track_destroy] = true
    options.delete(:dependent)
  end

  result
end