summaryrefslogtreecommitdiff
path: root/app/models/oauth_access_token.rb
blob: e8595b13d6d2f46f9303539054084da79aaeff58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class OauthAccessToken < Doorkeeper::AccessToken
  belongs_to :resource_owner, class_name: 'User'
  belongs_to :application, class_name: 'Doorkeeper::Application'

  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