Skip to content

Instantly share code, notes, and snippets.

@lusis
Created June 30, 2010 17:24
Show Gist options
  • Save lusis/458967 to your computer and use it in GitHub Desktop.
Save lusis/458967 to your computer and use it in GitHub Desktop.
class Tester
include DataMapper::Resource
property :id, Serial
property :name, String, :required => true, :length => 75
property :email, String, :required => true, :length => 75, :unique_index => true
property :comments, Text
property :created_at, DateTime
has n, :skills
has n, :languages, :through => :skills
end
class Language
include DataMapper::Resource
property :id, Serial
property :name, String, :unique_index => true
property :created_at, DateTime
has n, :skills
has n, :testers, :through => :skills
end
class Skill
include DataMapper::Resource
property :language_id, Integer, :key => true
property :tester_id, Integer, :key => true
belongs_to :language
belongs_to :tester
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment