Skip to content
This repository has been archived by the owner on Aug 22, 2020. It is now read-only.

Commit

Permalink
use hash accessors for creating from omniauth hash
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-mcdonald committed Apr 14, 2012
1 parent d6a6981 commit c1b6a5e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/models/user.rb
Expand Up @@ -5,13 +5,13 @@ class User < ActiveRecord::Base

def self.new_from_hash(auth_hash)
user = User.new(
email: auth_hash.info.email,
name: auth_hash.info.name
email: auth_hash[:info][:email],
name: auth_hash[:info][:name]
)
user.authorizations.new(
email: auth_hash.info.email,
provider: auth_hash.provider,
uid: auth_hash.uid
email: auth_hash[:info][:email],
provider: auth_hash[:provider],
uid: auth_hash[:uid]
)
user
end
Expand Down

0 comments on commit c1b6a5e

Please sign in to comment.