Skip to content

Instantly share code, notes, and snippets.

@sausheong
Created December 6, 2009 10:16
Show Gist options
  • Save sausheong/250144 to your computer and use it in GitHub Desktop.
Save sausheong/250144 to your computer and use it in GitHub Desktop.
DataMapper.setup(:default, ENV['DATABASE_URL'] || 'mysql://root:root@localhost/snip')
class Url
include DataMapper::Resource
property :id, Serial
property :original, String, :length => 255
property :created_at, DateTime
def snipped() self.id.to_s(36) end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment