Module: Mongoid::Xoauth
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/mongoid/xoauth.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#find_by_oauth_uid(uid, klass) ⇒ Object
20 21 22 |
# File 'lib/mongoid/xoauth.rb', line 20 def find_by_oauth_uid(uid, klass) where('oauths.uid' => uid.to_s, 'oauths._type' => klass.to_s).first end |
#oauth(klass) ⇒ Object
24 25 26 |
# File 'lib/mongoid/xoauth.rb', line 24 def oauth(klass) self.oauths.find_by(_type: klass.to_s) # "Oauth::#{name.to_s.capitalize}" end |