Skip to content

Instantly share code, notes, and snippets.

@patmaddox
Created January 10, 2009 19:49
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 patmaddox/45543 to your computer and use it in GitHub Desktop.
Save patmaddox/45543 to your computer and use it in GitHub Desktop.
module Twinkies
class Item
include DataMapper::Resource
property :id, Integer, :serial => true
property :twitter_id, Integer
property :link, String
property :user, String
property :created_at, DateTime
property :text, Text, :lazy => false
property :guid, String, :default => Proc.new { Guid.new.to_s }
def self.inherited(klass)
DataMapper::Resource.descendants << klass
super
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment