18F/identity-idp

View on GitHub
lib/data_requests/deployed/lookup_user_by_uuid.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module DataRequests
  module Deployed
    class LookupUserByUuid
      attr_reader :uuid

      def initialize(uuid)
        @uuid = uuid
      end

      def call
        User.find_by(uuid: uuid) ||
          ServiceProviderIdentity.find_by(uuid: uuid)&.user
      end
    end
  end
end