Skip to content

Instantly share code, notes, and snippets.

@syrm
Created November 15, 2010 11:13
Show Gist options
  • Save syrm/700262 to your computer and use it in GitHub Desktop.
Save syrm/700262 to your computer and use it in GitHub Desktop.
Un petit exemple de DataMapper
class Player
include DataMapper::Resource
property :id, Integer, :key => true
property :name, String
property :hfr_name, String
property :last_statistics_id, Integer
has 1, :lastStatistics, 'Statistics',
:parent_key => [ :id, :last_statistics_id ],
:child_key => [ :player_id, :id ]
has n, :statistics, 'Statistics'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment