Skip to content

Instantly share code, notes, and snippets.

@sishen
Created August 16, 2012 14:18
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 sishen/3370424 to your computer and use it in GitHub Desktop.
Save sishen/3370424 to your computer and use it in GitHub Desktop.
Sample Spine.js Model in Pragmatic.ly
class App.Project extends Spine.Model
@configure 'Project', 'id', 'name', 'description', 'owner_id', 'uid'
@extend Spine.Model.Ajax
@extend Spine.Model.Dirty
validate: ->
'name required' unless @name
inviteUser: (email) ->
App.Invitation.create(project_id: @id, email: email)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment