Skip to content

Commit

Permalink
Enable communities setting when we deposit dataset as 3rd copy to zenodo
Browse files Browse the repository at this point in the history
  • Loading branch information
sfisher committed May 22, 2020
1 parent b4c3789 commit 20cba55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions spec/lib/stash/zenodo_replicate/metadata_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ module ZenodoReplicate
expect(@mg.notes.scan(/Award Number/).count).to eq(1)
end

it 'sets an item to the community' do
expect(@mg.communities).to eq([{ identifier: APP_CONFIG.zenodo.community_id }])
end

it 'has method output' do
expect(@mg.method).to eq(@resource.descriptions.where(description_type: 'methods').first.description)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(resource:, use_zenodo_doi: false)
def metadata
out_hash = {}.with_indifferent_access
%i[doi upload_type publication_date title creators description access_right license
keywords notes related_identifiers method locations].each do |meth|
keywords notes related_identifiers method locations communities].each do |meth|
next if meth == 'doi' && @use_zenodo_doi
result = send(meth)
out_hash[meth] = result unless result.blank?
Expand Down Expand Up @@ -100,6 +100,10 @@ def locations
end.compact
end

def communities
[{ identifier: APP_CONFIG.zenodo.community_id }]
end

def location(geolocation)
# no way to represent boxes in zenodo?
return nil if geolocation.place_id.nil? && geolocation.point_id.nil?
Expand Down

0 comments on commit 20cba55

Please sign in to comment.