app/models/bplmodels/characterization.rb
def append_metadata
      terms = self.characterization_terms
      #Sufia.config.fits_to_desc_mapping.each_pair do |k, v|
      fits_config_values.each_pair do |k, v|
        if terms.has_key?(k)
          # coerce to array to remove a conditional
          terms[k] = [terms[k]] unless terms[k].is_a? Array
          terms[k].each do |term_value|
            proxy_term = self.send(v)
            if proxy_term.kind_of?(Array)
              proxy_term << term_value unless proxy_term.include?(term_value)
            else
              # these are single-valued terms which cannot be appended to
              self.send("#{v}=", term_value)
            end
          end
        end
      end
    end
# Populate descMetadata with fields from FITS (e.g. Author from pdfs)
Populate descMetadata with fields from FITS
Populate descMetadata with fields from FITS
def append_metadata
      terms = self.characterization_terms
      fits_config_values.each_pair do |k, v|
        if terms.has_key?(k)
          terms[k] = [terms[k]] unless terms[k].is_a? Array
          terms[k].each do |term_value|
            proxy_term = self.send(v)
            if proxy_term.kind_of?(Array)
              proxy_term << term_value unless proxy_term.include?(term_value)
            else
              self.send("#{v}=", term_value)
            end
          end
        end
      end
    end
def append_metadata terms = self . characterization_terms fits_config_values . each_pair do | k , v | if terms . has_key? ( k ) terms [ k ] = [ terms [ k ] ] unless terms [ k ] . is_a? Array terms [ k ] . each do | term_value | proxy_term = self . send ( v ) if proxy_term . kind_of? ( Array ) proxy_term << term_value unless proxy_term . include? ( term_value ) else self . send ( "#{v}=" , term_value ) end end end end end
Populate descMetadata with fields from FITS (e.g.
Populate descMetadata with fields from FITS ( e . g .
#Sufia.config.fits_to_desc_mapping.each_pair do |k, v| # coerce to array to remove a conditional # these are single-valued terms which cannot be appended to