asciinema.org/app/models/user.rb
2012-02-25 23:42:44 +01:00

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