Module: RailsJwtAuth::Authenticatable::ClassMethods
- Defined in:
- app/models/concerns/rails_jwt_auth/authenticatable.rb
Instance Method Summary collapse
Instance Method Details
#get_by_token(token) ⇒ Object
42 43 44 45 46 47 48 |
# File 'app/models/concerns/rails_jwt_auth/authenticatable.rb', line 42 def get_by_token(token) if defined?(Mongoid) && ancestors.include?(Mongoid::Document) where(auth_tokens: token).first elsif defined?(ActiveRecord) && ancestors.include?(ActiveRecord::Base) where('auth_tokens like ?', "%#{token}%").first end end |