Class: User

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/templates/app/models/user.rb

Class Method Summary collapse

Class Method Details

.create_from_hash!(hash) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/templates/app/models/user.rb', line 4

def self.create_from_hash!(hash)
  create(:name => hash['user_info']['name'],
         :location => hash['user_info']['location'] || "",
         :nickname => hash['user_info']['nickname'] || "",
         :image => hash['user_info']['image'] || "",
         :description => hash['user_info']['description'] || "")
end