Class: Devise::Oauth::Client

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Blockable, Scopable
Defined in:
app/models/devise/oauth/client.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Blockable

#blocked?, #unblock!

Methods included from Scopable

#has_scope?, #scope, #scope=, #scope_to_response

Class Method Details

.client_ownable?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'app/models/devise/oauth/client.rb', line 3

def self.client_ownable?
  Devise::Oauth.client_owner.constantize.devise_modules.include? :client_ownable
end

Instance Method Details

#block!Object



22
23
24
25
26
# File 'app/models/devise/oauth/client.rb', line 22

def block!
  super
  AccessToken.block_client!  id
  Authorization.block_client! id
end

#granted!Object



31
32
33
# File 'app/models/devise/oauth/client.rb', line 31

def granted!
  self.class.update_counters(id, granted_times: 1)
end

#revoked!Object



35
36
37
# File 'app/models/devise/oauth/client.rb', line 35

def revoked!
  self.class.update_counters(id, revoked_times: 1)
end