Sha256: 71c03abca1cd9fc232b55fee826902ed7b1fffd6ad12f30a20572e59a9d14b74
Contents?: true
Size: 371 Bytes
Versions: 3
Compression:
Stored size: 371 Bytes
Contents
class Identity < ActiveRecord::Base belongs_to :user validates_presence_of :user_id, :uid, :provider validates_uniqueness_of :uid, :scope => :provider def self.find_for_oauth(auth) identity = find_by(provider: auth.provider, uid: auth.uid) identity = create(uid: auth.uid, provider: auth.provider) if identity.nil? identity end # self.find_for_oauth end
Version data entries
3 entries across 3 versions & 1 rubygems