Class: User

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/generators/sso_client/install/templates/model.rb

Class Method Summary collapse

Class Method Details

.from_omniauth(hash) ⇒ Object



5
6
7
8
9
# File 'lib/generators/sso_client/install/templates/model.rb', line 5

def self.from_omniauth(hash)
  User.find_or_initialize_by_uid(hash['uid']).tap do |user|
    user.update_attributes hash['info']
  end
end