Skip to content

Instantly share code, notes, and snippets.

@jergason
Created June 22, 2011 22:34
Show Gist options
  • Save jergason/1041434 to your computer and use it in GitHub Desktop.
Save jergason/1041434 to your computer and use it in GitHub Desktop.
Two has-and-belongs-to-many Properties to the same model
class Comparison
include DataMapper::Resource
property :id, Serial
has n, :msruns, :through => Resource
has n, :msruns, :through => Resource
belongs_to :metric
end
class Msrun
include DataMapper::Resource
property :id, Serial, :key => true
has n, :comparisons, :through => Resource
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment