Module: VestalVersions::Creation::ClassMethods

Defined in:
lib/vestal_versions/creation.rb

Overview

Class methods added to ActiveRecord::Base to facilitate the creation of new versions.

Instance Method Summary collapse

Instance Method Details

#prepare_versioned_options_with_creation(options) ⇒ Object

Overrides the basal prepare_versioned_options method defined in VestalVersions::Options to extract the :only and :except options into vestal_versions_options.



23
24
25
26
27
28
29
30
# File 'lib/vestal_versions/creation.rb', line 23

def prepare_versioned_options_with_creation(options)
  result = prepare_versioned_options_without_creation(options)

  self.vestal_versions_options[:only] = Array(options.delete(:only)).map(&:to_s).uniq if options[:only]
  self.vestal_versions_options[:except] = Array(options.delete(:except)).map(&:to_s).uniq if options[:except]

  result
end