Module VestalVersions::Configuration
In: lib/vestal_versions/configuration.rb

Allows for easy application-wide configuration of options passed into the versioned method.

Methods

Public Class methods

If given a setter method name, will assign the first argument to the options hash with the method name (sans "=") as the key. If given a getter method name, will attempt to a value from the options hash for that key. If the key doesn‘t exist, defers to super.

Simply stores a hash of options given to the configure block.

Public Instance methods

The VestalVersions module is extended by VestalVersions::Configuration, allowing the +configure method+ to be used as follows in a Rails initializer:

  VestalVersions.configure do |config|
    config.class_name = "MyCustomVersion"
    config.dependent = :destroy
  end

Each variable assignment in the configure block corresponds directly with the options available to the versioned method. Assigning common options in an initializer can keep your models tidy.

If an option is given in both an initializer and in the options passed to versioned, the value given in the model itself will take precedence.

[Validate]