Permalink
Browse files

use hash accessors for creating from omniauth hash

  • Loading branch information...
1 parent d6a6981 commit c1b6a5e90a14db8c01651b75a4c2ac0c81506935 @thomas-mcdonald committed Apr 14, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 app/models/user.rb
View
@@ -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

0 comments on commit c1b6a5e

Please sign in to comment.