app/models/bplmodels/mods_desc_metadata.rb
#include Hydra::Datastream::CommonModsIndexMethods
# MODS XML constants.
include Hydra::Datastream::CommonModsIndexMethods
MODS XML constants.
include Hydra :: Datastream :: CommonModsIndexMethods MODS XML constants .
def insert_series(series)
      if series.present?
        top_level_insert_position = self.mods(0).related_item.length
        0.upto self.mods(0).related_item.length-1 do |pos|
          if self.mods(0).related_item(pos).type == ['series']
            top_level_insert_position = pos
          end
        end
        if self.mods(0).related_item(top_level_insert_position).blank?
          self.mods(0).related_item(top_level_insert_position).type = 'series'
          self.mods(0).related_item(top_level_insert_position).title_info.title = series
        elsif self.mods(0).related_item(top_level_insert_position).related_item(0).blank?
          self.mods(0).related_item(top_level_insert_position).related_item(0).type = 'series'
          self.mods(0).related_item(top_level_insert_position).related_item(0).title_info.title = series
        elsif self.mods(0).related_item(top_level_insert_position).related_item(0).related_item(0).blank?
          self.mods(0).related_item(top_level_insert_position).related_item(0).related_item(0).type = 'series'
          self.mods(0).related_item(top_level_insert_position).related_item(0).related_item(0).title_info.title = series
        elsif self.mods(0).related_item(top_level_insert_position).related_item(0).related_item(0).related_item(0).blank?
          self.mods(0).related_item(top_level_insert_position).related_item(0).related_item(0).related_item(0).type = 'series'
          self.mods(0).related_item(top_level_insert_position).related_item(0).related_item(0).related_item(0).title_info.title = series
        elsif self.mods(0).related_item(top_level_insert_position).related_item(0).related_item(0).related_item(0).related_item(0).blank?
          self.mods(0).related_item(top_level_insert_position).related_item(0).related_item(0).related_item(0).related_item(0).type = 'series'
          self.mods(0).related_item(top_level_insert_position).related_item(0).related_item(0).related_item(0).related_item(0).title_info.title = series
        end
      end
    end
def insert_series ( series ) if series . present? top_level_insert_position = self . mods ( 0 ) . related_item . length 0 . upto self . mods ( 0 ) . related_item . length - 1 do | pos | if self . mods ( 0 ) . related_item ( pos ) . type == [ 'series' ] top_level_insert_position = pos end end if self . mods ( 0 ) . related_item ( top_level_insert_position ) . blank? self . mods ( 0 ) . related_item ( top_level_insert_position ) . type = 'series' self . mods ( 0 ) . related_item ( top_level_insert_position ) . title_info . title = series elsif self . mods ( 0 ) . related_item ( top_level_insert_position ) . related_item ( 0 ) . blank? self . mods ( 0 ) . related_item ( top_level_insert_position ) . related_item ( 0 ) . type = 'series' self . mods ( 0 ) . related_item ( top_level_insert_position ) . related_item ( 0 ) . title_info . title = series elsif self . mods ( 0 ) . related_item ( top_level_insert_position ) . related_item ( 0 ) . related_item ( 0 ) . blank? self . mods ( 0 ) . related_item ( top_level_insert_position ) . related_item ( 0 ) . related_item ( 0 ) . type = 'series' self . mods ( 0 ) . related_item ( top_level_insert_position ) . related_item ( 0 ) . related_item ( 0 ) . title_info . title = series elsif self . mods ( 0 ) . related_item ( top_level_insert_position ) . related_item ( 0 ) . related_item ( 0 ) . related_item ( 0 ) . blank? self . mods ( 0 ) . related_item ( top_level_insert_position ) . related_item ( 0 ) . related_item ( 0 ) . related_item ( 0 ) . type = 'series' self . mods ( 0 ) . related_item ( top_level_insert_position ) . related_item ( 0 ) . related_item ( 0 ) . related_item ( 0 ) . title_info . title = series elsif self . mods ( 0 ) . related_item ( top_level_insert_position ) . related_item ( 0 ) . related_item ( 0 ) . related_item ( 0 ) . related_item ( 0 ) . blank? self . mods ( 0 ) . related_item ( top_level_insert_position ) . related_item ( 0 ) . related_item ( 0 ) . related_item ( 0 ) . related_item ( 0 ) . type = 'series' self . mods ( 0 ) . related_item ( top_level_insert_position ) . related_item ( 0 ) . related_item ( 0 ) . related_item ( 0 ) . related_item ( 0 ) . title_info . title = series end end end
include Hydra::Datastream::CommonModsIndexMethods
MODS XML constants.
include Hydra :: Datastream :: CommonModsIndexMethods MODS XML constants .
series