module Omniauth::MultipleProviders::Omniauthable

Public Instance Methods

create_or_update_provider_user_by(auth) click to toggle source
# File lib/omniauth/multiple_providers/models/concerns/omniauthable.rb, line 12
def create_or_update_provider_user_by(auth)
  if provider_user = self.provider_users.find_by(uid: auth['uid'], provider: auth['provider'])
    provider_user.update_by(auth)
  else
    provider_user = self.provider_users.build
    provider_user.update_by(auth)
  end
end
oauthed?(provider_name) click to toggle source
# File lib/omniauth/multiple_providers/models/concerns/omniauthable.rb, line 21
def oauthed?(provider_name)
  if up = self.provider_users.find_by(provider: provider_name)
    up
  else
    nil
  end
end