Skip to content

Instantly share code, notes, and snippets.

@almost
Created November 26, 2011 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almost/1396310 to your computer and use it in GitHub Desktop.
Save almost/1396310 to your computer and use it in GitHub Desktop.
class Post extends Model
@field 'title', default: 'New post!'
@field 'body'
# the default is supplied as a closure which is evaluated at object
# creation time
@field 'created_at', default: -> new Date()
class User extends Model
@field 'username'
@field 'twitter'
@has_many Post, as: 'posts'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment