Created
August 1, 2010 19:15
-
-
Save xrd/503657 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# user.rb | |
class User | |
include DataMapper::Resource | |
# has_and_belongs_to_many :groups | |
has n, :groups, :through => Resource | |
has n, :links | |
property :id, Serial | |
property :email, String, :required => true, :length => 500 | |
property :identifier, String, :required => true, :length => 500 | |
property :username, String, :required => true, :length => 500 | |
property :nickname, String, :required => true, :length => 500 | |
property :photo, String, :required => true, :length => 500 | |
timestamps :at | |
end | |
# group.rb | |
class Group | |
has n, :links | |
has n, :users, :through => Resource | |
include DataMapper::Resource | |
property :id, Serial | |
property :name, String, :required => true, :length => 500 | |
property :user_id, Integer, :required => true | |
timestamps :at | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment