diff options
| author | mo k <mo@mokhan.ca> | 2012-08-26 10:04:37 -0600 |
|---|---|---|
| committer | mo k <mo@mokhan.ca> | 2012-08-26 10:04:37 -0600 |
| commit | 9383da9773a51c44aec2a44e1cab9b0b46e7cf1a (patch) | |
| tree | b68b7ea24783f6f432d0a47445d927647bcfbc5f /app/models/user.rb | |
| parent | b3640bddef1f6cc73aaf12c67e3525dbb6f17d98 (diff) | |
add usermain
Diffstat (limited to 'app/models/user.rb')
| -rw-r--r-- | app/models/user.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 5b54886..720f240 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,3 +1,12 @@ class User < ActiveRecord::Base attr_accessible :name, :provider, :uid + + def self.create_with_omniauth(auth) + Rails.logger.info "#{auth}" + create! do |user| + user.provider = auth["provider"] + user.uid = auth["uid"] + user.name = auth["info"]["name"] + end + end end |
