Created
May 17, 2012 18:45
-
-
Save DanCoughlin/2720845 to your computer and use it in GitHub Desktop.
issue with facets improperly displaying
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.fits_to_desc_mapping = { | |
:format_label => :format, | |
:last_modified => :date_modified, | |
:original_checksum => :identifier, | |
:rights_basis => :rights, | |
:copyright_basis => :rights, | |
:copyright_note => :rights, | |
:file_title => :title, | |
:file_author => :creator, | |
:file_language => :language | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# delegates to the datastream | |
delegate :resource_type, :to => :descMetadata | |
delegate :format, :to => :descMetadata | |
delegate :identifier, :to => :descMetadata | |
delegate :format_label, :to => :characterization | |
# characterize calls this fcn | |
def append_metadata | |
terms = self.characterization_terms | |
ScholarSphere::Application.config.fits_to_desc_mapping.each_pair do |k, v| | |
if terms.has_key?(k) | |
proxy_term = self.send(v) | |
if terms[k].is_a? Array | |
terms[k].each do |term_value| | |
proxy_term << term_value unless proxy_term.include?(term_value) | |
end | |
else | |
proxy_term << terms[k] | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment