Module: Dor::Versionable
- Extended by:
- ActiveSupport::Concern, Deprecation
- Included in:
- Abstract
- Defined in:
- lib/dor/models/concerns/versionable.rb
Instance Method Summary collapse
-
#allows_modification? ⇒ Boolean
This is used by Argo and the MergeService.
-
#close_version(opts = {}) ⇒ Object
Sets versioningWF:submit-version to completed and initiates accessionWF for the object.
- #current_version ⇒ Object
-
#new_version_open? ⇒ Boolean
True if ‘opened’ lifecycle is active, false otherwise.
-
#open_new_version(opts = {}) ⇒ Object
Increments the version number and initializes versioningWF for the object.
-
#start_version ⇒ Object
Following chart of processes on this consul page: consul.stanford.edu/display/chimera/Versioning+workflows.
- #submit_version ⇒ Object
Instance Method Details
#allows_modification? ⇒ Boolean
This is used by Argo and the MergeService
51 52 53 54 55 56 57 58 59 |
# File 'lib/dor/models/concerns/versionable.rb', line 51 def allows_modification? if Dor::Config.workflow.client.get_lifecycle('dor', pid, 'submitted') && !VersionService.new(self).open? && Dor::Config.workflow.client.get_workflow_status('dor', pid, 'accessionWF', 'sdr-ingest-transfer') != 'hold' false else true end end |
#close_version(opts = {}) ⇒ Object
Sets versioningWF:submit-version to completed and initiates accessionWF for the object
37 38 39 |
# File 'lib/dor/models/concerns/versionable.rb', line 37 def close_version(opts = {}) VersionService.close(self, opts) end |
#current_version ⇒ Object
24 25 26 |
# File 'lib/dor/models/concerns/versionable.rb', line 24 def current_version versionMetadata.current_version_id end |
#new_version_open? ⇒ Boolean
Returns true if ‘opened’ lifecycle is active, false otherwise.
43 44 45 |
# File 'lib/dor/models/concerns/versionable.rb', line 43 def new_version_open? VersionService.new(self).open? end |
#open_new_version(opts = {}) ⇒ Object
Increments the version number and initializes versioningWF for the object
19 20 21 |
# File 'lib/dor/models/concerns/versionable.rb', line 19 def open_new_version(opts = {}) VersionService.open(self, opts) end |
#start_version ⇒ Object
Following chart of processes on this consul page: consul.stanford.edu/display/chimera/Versioning+workflows
62 63 64 |
# File 'lib/dor/models/concerns/versionable.rb', line 62 def start_version open_new_version end |
#submit_version ⇒ Object
67 68 69 |
# File 'lib/dor/models/concerns/versionable.rb', line 67 def submit_version close_version end |