lib/dwc-archive/classification_normalizer.rb in dwc-archive-0.5.3 vs lib/dwc-archive/classification_normalizer.rb in dwc-archive-0.5.4
- old
+ new
@@ -61,10 +61,10 @@
a_scientific_name.force_encoding('utf-8')
end
canonical_name = @parser.parse(a_scientific_name, :canonical_only => true)
add_name_string(a_scientific_name)
add_name_string(canonical_name) unless canonical_name.to_s.empty?
- canonical_name.empty? ? a_scientific_name : canonical_name
+ canonical_name.to_s.empty? ? a_scientific_name : canonical_name
end
def get_fields(element)
data = element.fields.inject({}) { |res, f| res[f[:term].split('/')[-1].downcase.to_sym] = f[:index].to_i; res }
data[:id] = element.id[:index]