Class: Dor::Upgradable::Callback
- Inherits:
-
Struct
- Object
- Struct
- Dor::Upgradable::Callback
- 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
-
#block ⇒ Object
Returns the value of attribute block.
-
#description ⇒ Object
Returns the value of attribute description.
-
#module ⇒ Object
Returns the value of attribute module.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
24 25 26 |
# File 'lib/dor/models/upgradable.rb', line 24 def block @block end |
#description ⇒ Object
Returns the value of attribute description
24 25 26 |
# File 'lib/dor/models/upgradable.rb', line 24 def description @description end |
#module ⇒ Object
Returns the value of attribute module
24 25 26 |
# File 'lib/dor/models/upgradable.rb', line 24 def module @module end |
#version ⇒ Object
Returns the value of attribute version
24 25 26 |
# File 'lib/dor/models/upgradable.rb', line 24 def version @version end |