You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: authorization.rb
    path of file: ./repos/diaspora/app/models/api/openid_connect
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# Inspired by https://github.com/nov/openid_connect_sample/blob/master/app/models/authorization.rb

module Api
  module OpenidConnect
    class Authorization < ApplicationRecord
      belongs_to
    
      def self.find_by_client_id_user_and_scopes(client_id, user, scopes)
        app = Api::OpenidConnect::OAuthApplication.where(client_id: client_id)
        authorizations = where(o_auth_application: app, user: user).all
        authorizations.each do |authorization|
          if authorization.scopes.uniq.sort == Array(scopes).uniq.sort
            return authorization
          end
        end