lib/authority_control/record_update.rb
### Adds subfields 3, 4, 5, 6, and 8 to a corrected heading or a derived heading
###   in the LCSH vocabulary
Adds subfields 3, 4, 5, 6, and 8 to a corrected heading or a derived heading
in the LCSH vocabulary
Adds subfields 3 4 5 6 and 8 to a corrected heading or a derived heading in the LCSH vocabulary
def add_non_heading_subfields_to_subject_field(field, new_field)
  subf4 = field.subfields.select { |subfield| subfield.code == '4' }
  subf4.each do |subfield|
    new_field.subfields.insert(0, subfield)
  end
  subf5 = field.subfields.select { |subfield| subfield.code == '5' }
  subf5.each do |subfield|
    new_field.subfields.append(subfield)
  end
  subf3 = field.subfields.select { |subfield| subfield.code == '3' }
  subf3.each do |subfield|
    new_field.subfields.insert(0, subfield)
  end
  subf6 = field.subfields.select { |subfield| subfield.code == '6' }
  subf6.each do |subfield|
    new_field.subfields.insert(0, subfield)
  end
  subf8 = field.subfields.select { |subfield| subfield.code == '8' }
  subf8.each do |subfield|
    new_field.subfields.insert(0, subfield)
  end
  new_field
end
def add_non_heading_subfields_to_subject_field ( field , new_field ) subf4 = field . subfields . select { | subfield | subfield . code == '4' } subf4 . each do | subfield | new_field . subfields . insert ( 0 , subfield ) end subf5 = field . subfields . select { | subfield | subfield . code == '5' } subf5 . each do | subfield | new_field . subfields . append ( subfield ) end subf3 = field . subfields . select { | subfield | subfield . code == '3' } subf3 . each do | subfield | new_field . subfields . insert ( 0 , subfield ) end subf6 = field . subfields . select { | subfield | subfield . code == '6' } subf6 . each do | subfield | new_field . subfields . insert ( 0 , subfield ) end subf8 = field . subfields . select { | subfield | subfield . code == '8' } subf8 . each do | subfield | new_field . subfields . insert ( 0 , subfield ) end new_field end
Adds subfields 3, 4, 5, 6, and 8 to a corrected heading or a derived heading
in the LCSH vocabulary
Adds subfields 3 4 5 6 and 8 to a corrected heading or a derived heading in the LCSH vocabulary
field
new_field