Skip to content

Instantly share code, notes, and snippets.

@DanCoughlin
Created May 17, 2012 18:45
Show Gist options
  • Save DanCoughlin/2720845 to your computer and use it in GitHub Desktop.
Save DanCoughlin/2720845 to your computer and use it in GitHub Desktop.
issue with facets improperly displaying
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
}
# 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