Skip to content

Instantly share code, notes, and snippets.

@neaf
Created December 13, 2009 10:50
Show Gist options
  • Select an option

  • Save neaf/255380 to your computer and use it in GitHub Desktop.

Select an option

Save neaf/255380 to your computer and use it in GitHub Desktop.
class Project
include MongoMapper::Document
key :name, String
key :budget, Integer
key :details
def type
details.class.to_s.gsub("Project", "")
end
end
class DesignProject
include MongoMapper::EmbeddedDocument
end
class MarkupProject
include MongoMapper::EmbeddedDocument
end
class ApplicationProject
include MongoMapper::EmbeddedDocument
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment