Skip to content

Instantly share code, notes, and snippets.

@vangberg
Created July 23, 2008 13:45
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 vangberg/1726 to your computer and use it in GitHub Desktop.
Save vangberg/1726 to your computer and use it in GitHub Desktop.
gem 'dm-core'
require 'dm-core'
APP_ROOT = File.expand_path(File.dirname(__FILE__))
# Database stuff
DataMapper.setup(:default, "sqlite3:#{APP_ROOT}/tezeta.db")
class User
include DataMapper::Resource
property :id, Integer, :serial => true
property :login, String
property :extension, String
property :node, String
has n, :call_logs
end
class CallLog
include DataMapper::Resource
property :id, Integer, :serial => true
property :type, String
property :caller_id, String
property :created_at, DateTime
belongs_to :user
end
DataMapper.auto_upgrade!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment