class Doorkeeper::OAuth::Scopes

def exists?(scope)

def exists?(scope)
  scope = scope.to_s
  @scopes.any? do |allowed_scope|
    if dynamic_scopes_enabled? && dynamic_scopes_present?(allowed_scope, scope)
      dynamic_scope_match?(allowed_scope, scope)
    else
      allowed_scope == scope
    end
  end
end