15 lines
304 B
Ruby
15 lines
304 B
Ruby
class User < ActiveRecord::Base
|
|
|
|
validate :provider, :presence => true
|
|
validate :uid, :presence => true
|
|
|
|
def self.create_with_omniauth(auth)
|
|
create! do |user|
|
|
user.provider = auth["provider"]
|
|
user.uid = auth["uid"]
|
|
user.name = auth["info"]["name"]
|
|
end
|
|
end
|
|
|
|
end
|