Skip to content

Instantly share code, notes, and snippets.

@takuyan
Created August 22, 2012 14:08
Show Gist options
  • Save takuyan/3425964 to your computer and use it in GitHub Desktop.
Save takuyan/3425964 to your computer and use it in GitHub Desktop.
#
# lib/models/article.coffee
# => Resources/models/article.js
#
TiActiveRecord = require 'lib/TiActiveRecord'
class Article extends TiActiveRecord
@dbName = 'myapp'
@tableName = 'articles'
# @remove_auto_increment = true # If you do not need 'AUTOINCREMENT' to id, please set to true
# @remove_primary_key = true # If you do not need 'PRIMARY KEY' to id, please set to true
@properties =
uid: 'integer'
title: 'text'
body: 'text'
image_url: 'text'
image_name: 'text'
pv: 'integer'
Article.init()
module.exports = Article
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment