lib/aleph/borrower.rb
def update_user(user)
      @user_id = "#{config.bor_prefix}-#{user.cas_username}"
      z303, z304, z305, z308 = information_from_user_object(user)
      if aleph_full_lookup(z308)
        if config.create_aleph_borrowers
          if @aleph_pid.nil? || @aleph_pid.empty?
            bor_new('I', z303, z304, z305, z308)

            @aleph_pid = aleph_lookup(z308[0])
            if @aleph_pid.nil? || @aleph_pid.empty?
              raise Aleph::Error, 'Borrower could not be created in ALEPH'
            end
          else
            aleph_update(z303, z304, z305, z308)
          end
        end
      elsif try_to_fix_non_matching_aleph_ids(user)
        z303, z304, z305, z308 = information_from_user_object(user)
        if aleph_full_lookup(z308)
          aleph_update(z303, z304, z305, z308)
        else
          msg = 'Still non matching ALEPH ids after trying to fix'
          msg += "\n" + Aleph::Borrower.new.lookup_all(user).ai(plain: true)
          msg += "\n" + user.ai(plain: true)
        end
      else
        @aleph_pid = nil
        msg = 'Non matching ALEPH ids'
        msg += "\n" + Aleph::Borrower.new.lookup_all(user).ai(plain: true)
        msg += "\n" + user.ai(plain: true)
      end
    end
#   Update aleph user from riyosha user
Update aleph user from riyosha user
Update aleph user from riyosha user
def update_user(user)
      @user_id = "#{config.bor_prefix}-#{user.cas_username}"
      z303, z304, z305, z308 = information_from_user_object(user)
      if aleph_full_lookup(z308)
        if config.create_aleph_borrowers
          if @aleph_pid.nil? || @aleph_pid.empty?
            bor_new('I', z303, z304, z305, z308)
            @aleph_pid = aleph_lookup(z308[0])
            if @aleph_pid.nil? || @aleph_pid.empty?
              raise Aleph::Error, 'Borrower could not be created in ALEPH'
            end
          else
            aleph_update(z303, z304, z305, z308)
          end
        end
      elsif try_to_fix_non_matching_aleph_ids(user)
        z303, z304, z305, z308 = information_from_user_object(user)
        if aleph_full_lookup(z308)
          aleph_update(z303, z304, z305, z308)
        else
          msg = 'Still non matching ALEPH ids after trying to fix'
          msg += "\n" + Aleph::Borrower.new.lookup_all(user).ai(plain: true)
          msg += "\n" + user.ai(plain: true)
        end
      else
        @aleph_pid = nil
        msg = 'Non matching ALEPH ids'
        msg += "\n" + Aleph::Borrower.new.lookup_all(user).ai(plain: true)
        msg += "\n" + user.ai(plain: true)
      end
    end
def update_user ( user ) @user_id = "#{config.bor_prefix}-#{user.cas_username}" z303 , z304 , z305 , z308 = information_from_user_object ( user ) if aleph_full_lookup ( z308 ) if config . create_aleph_borrowers if @aleph_pid . nil? || @aleph_pid . empty? bor_new ( 'I' , z303 , z304 , z305 , z308 ) @aleph_pid = aleph_lookup ( z308 [ 0 ] ) if @aleph_pid . nil? || @aleph_pid . empty? raise Aleph :: Error , 'Borrower could not be created in ALEPH' end else aleph_update ( z303 , z304 , z305 , z308 ) end end elsif try_to_fix_non_matching_aleph_ids ( user ) z303 , z304 , z305 , z308 = information_from_user_object ( user ) if aleph_full_lookup ( z308 ) aleph_update ( z303 , z304 , z305 , z308 ) else msg = 'Still non matching ALEPH ids after trying to fix' msg += "\n" + Aleph :: Borrower . new . lookup_all ( user ) . ai ( plain : true ) msg += "\n" + user . ai ( plain : true ) end else @aleph_pid = nil msg = 'Non matching ALEPH ids' msg += "\n" + Aleph :: Borrower . new . lookup_all ( user ) . ai ( plain : true ) msg += "\n" + user . ai ( plain : true ) end end
Update aleph user from riyosha user
Update aleph user from riyosha user
user