class Doorkeeper::AccessGrant

def self.authenticate(token)

def self.authenticate(token)
  where(token: token).first
end

def self.create_indexes

def self.create_indexes
  ensure_index :token, unique: true
end

def generate_token

def generate_token
  self.token = UniqueToken.generate
end

def scopes=(value)

def scopes=(value)
  write_attribute :scopes, value if value.present?
end