module VestalVersions::Creation::ClassMethods

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

Public Instance Methods

prepare_versioned_options_with_creation(options) click to toggle source

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

# 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