mirror of
https://github.com/wahyd4/libr-2.git
synced 2026-08-09 05:15:53 +10:00
11 lines
253 B
Ruby
11 lines
253 B
Ruby
class Identity < ActiveRecord::Base
|
|
belongs_to :user
|
|
validates_presence_of :uid, :provider
|
|
validates_uniqueness_of :uid, :scope => :provider
|
|
|
|
def self.find_for_oauth(auth)
|
|
find_or_create_by(uid: auth.uid, provider: auth.provider)
|
|
end
|
|
|
|
end
|