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

Commit

Permalink
index use_license_machine from rightsMetadata and default_use_license…
Browse files Browse the repository at this point in the history
…_machine from defaultObjectRights
  • Loading branch information
Darren Hardy committed Dec 14, 2015
1 parent 5ac98df commit a418132
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 113 deletions.
8 changes: 8 additions & 0 deletions lib/dor/datastreams/rights_metadata_ds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,16 @@ def to_solr(solr_doc = {}, *args)
%w(use_statement_ssim copyright_ssim).each do |key|
solr_doc[key] = solr_doc[key].reject { |val| val.nil? || val == '' }.flatten unless solr_doc[key].nil?
end
add_solr_value(solr_doc, 'use_license_machine', use_license, :string, [:stored_sortable])

solr_doc
end

def use_license
return creative_commons unless ['', nil].include?(creative_commons)
return open_data_commons unless ['', nil].include?(open_data_commons)
''
end

end # class
end
2 changes: 1 addition & 1 deletion lib/dor/models/editable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def to_solr(solr_doc = {}, *args)
super(solr_doc, *args)
add_solr_value(solr_doc, 'default_rights', default_rights, :string, [:symbol])
add_solr_value(solr_doc, 'agreement', agreement, :string, [:symbol]) if agreement_object
add_solr_value(solr_doc, 'use_license_machine', use_license, :string, [:stored_sortable])
add_solr_value(solr_doc, 'default_use_license_machine', use_license, :string, [:stored_sortable])
solr_doc
end

Expand Down

0 comments on commit a418132

Please sign in to comment.