Skip to content

Instantly share code, notes, and snippets.

@yusugomori
Created April 6, 2012 08:47
Show Gist options
  • Save yusugomori/2318251 to your computer and use it in GitHub Desktop.
Save yusugomori/2318251 to your computer and use it in GitHub Desktop.
app/models/user.coffee
#
# app/models/user.coffee
#
class App.User extends Tower.Model
@field "id", type: "Id"
@field "name", type: "String,"
@field "email", type: "String,"
@field "userId", type: "String,"
@timestamps()
@createFromFacebook: (session, accessToken, fbUserMetadata, promise) -> # '@'を忘れないように。
name = fbUserMetadata.name
email = fbUserMetadata.email
userId = fbUserMetadata.id
@.create
name: name
email: email
userId: userId
session.userId = userId
session.save()
promise.fulfill userId
@edubkendo
Copy link

" # '@'を忘れないように。"

Loose translation:
So that it doesn't forget '@'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment