gitlab-org--gitlab-foss/app/models/oauth_access_token.rb

17 lines
385 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class OauthAccessToken < Doorkeeper::AccessToken
belongs_to :resource_owner, class_name: 'User'
belongs_to :application, class_name: 'Doorkeeper::Application'
2017-10-30 13:49:46 -04:00
alias_attribute :user, :resource_owner
def scopes=(value)
if value.is_a?(Array)
super(Doorkeeper::OAuth::Scopes.from_array(value).to_s)
else
super
end
end
end