Module: Passport::Oauth::Queryable::ClassMethods

Defined in:
lib/passport/oauth/client/queryable.rb

Instance Method Summary collapse

Instance Method Details

#find_by_key_or_token(key, token) ⇒ Object

if we’re lucky we can find it by the token.



11
12
13
14
15
# File 'lib/passport/oauth/client/queryable.rb', line 11

def find_by_key_or_token(key, token)
  result = self.find_by_key(key) unless key.nil?
  result = self.find_by_token(token) if !(result && token.blank?)
  result 
end