Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Owner cannot be nil #367

Merged
merged 1 commit into from
Nov 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/dor/workflow/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ class Document
t.root(:path => 'workflow')
t.repository(:path => {:attribute => 'repository'})
t.workflowId(:path => {:attribute => 'id'})
t.process {
t.process do
t.name_(:path => {:attribute => 'name'})
t.status(:path => {:attribute => 'status'})
t.timestamp(:path => {:attribute => 'datetime'}) # , :data_type => :date)
t.elapsed(:path => {:attribute => 'elapsed'})
t.lifecycle(:path => {:attribute => 'lifecycle'})
t.attempts(:path => {:attribute => 'attempts'}, :index_as => [:not_searchable])
t.version(:path => {:attribute => 'version'})
}
end
end

@@definitions = {}
Expand Down
6 changes: 4 additions & 2 deletions lib/dor/workflow/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ def elapsed
@attrs['elapsed'].nil? ? nil : @attrs['elapsed'].to_f
end

def update!(info, new_owner = nil)
@owner = new_owner unless new_owner.nil?
# @param info [Nokogiri::XML::Element]
# @param new_owner [Dor::Workflow::Document]
def update!(info, new_owner)
@owner = new_owner
if info.is_a? Nokogiri::XML::Node
info = Hash[info.attributes.collect { |k, v| [k, v.value] }]
end
Expand Down