Module: Identity::Mixins::User::ClassMethods
- Defined in:
- lib/identity/mixins/user.rb
Instance Method Summary collapse
- #active ⇒ Object
- #find_first_by_auth_conditions(tainted_conditions, opts = {}) ⇒ Object
- #from_omniauth!(auth) ⇒ Object
Instance Method Details
#active ⇒ Object
33 34 35 36 37 |
# File 'lib/identity/mixins/user.rb', line 33 def active result = where(active: true) result = result.where.not(confirmed_at: nil) if devise_modules.include?(:confirmable) result end |
#find_first_by_auth_conditions(tainted_conditions, opts = {}) ⇒ Object
29 30 31 |
# File 'lib/identity/mixins/user.rb', line 29 def find_first_by_auth_conditions(tainted_conditions, opts = {}) super(tainted_conditions, send(Identity.active_scope).where_values_hash.merge(opts)) end |
#from_omniauth!(auth) ⇒ Object
23 24 25 26 27 |
# File 'lib/identity/mixins/user.rb', line 23 def from_omniauth!(auth) where(provider: auth.provider, uid: auth.uid).first_or_create! do |user| user.build_from_auth auth end end |