Class: Dor::Upgradable::Callback

Inherits:
Struct
  • Object
show all
Defined in:
lib/dor/models/upgradable.rb

Overview

The Upgradable mixin is responsible for making sure all DOR objects, concerns, and datastreams know how to upgrade themselves to the latest Chimera/DOR content standards.

To add a new upgrade: 1) include Dor::Upgradable within whatever model, datastream, or mixin

you want to make upgradable.

2) Add a block to the model, datastream, or mixin as follows:

on_upgrade(v) do |obj| 
  # Do whatever needs to be done to obj
end

where v is the first released version of dor-services that will
include the upgrade.

The block can either be defined on the model itself, or in a file in the dor/migrations/ directory. See Dor::Identifiable and dor/migrations/identifiable/* for an example.

Instance Attribute Summary collapse

Instance Attribute Details

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



24
25
26
# File 'lib/dor/models/upgradable.rb', line 24

def block
  @block
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



24
25
26
# File 'lib/dor/models/upgradable.rb', line 24

def description
  @description
end

#moduleObject

Returns the value of attribute module

Returns:

  • (Object)

    the current value of module



24
25
26
# File 'lib/dor/models/upgradable.rb', line 24

def module
  @module
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



24
25
26
# File 'lib/dor/models/upgradable.rb', line 24

def version
  @version
end