Skip to content

Instantly share code, notes, and snippets.

@bryansray
Created July 29, 2008 18:21
Show Gist options
  • Save bryansray/3139 to your computer and use it in GitHub Desktop.
Save bryansray/3139 to your computer and use it in GitHub Desktop.
class FeedItem
include DataMapper::Resource
property :id, Integer, :serial => true
property :feed_item_id, Integer
property :feed_item_type, String
property :created_at, DateTime
def initialize(feed_item)
self.feed_item_id = feed_item.id
self.feed_item_type = feed_item.class
save
end
def test
puts "Object = #{Object}" # > DataMapper::Types::Object
obj = Object.full_const_get(feed_item_type)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment