Created
August 9, 2011 05:34
-
-
Save cjheath/1133467 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
| class Authentication | |
| include DataMapper::Resource | |
| belongs_to :user | |
| property :id, Serial | |
| property :user_id, Integer | |
| property :provider, String | |
| property :uid, String, :length => 240 | |
| property :user_name, String, :length => 240 | |
| property :user_email, String, :length => 240 | |
| end |
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
| require 'uuidtools' | |
| class Project | |
| include DataMapper::Resource | |
| property :id, UUID, :key => true, :required => true, :default => proc { UUIDTools::UUID.random_create } | |
| property :name, String | |
| has 1, :user | |
| end |
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
| class User | |
| include DataMapper::Resource | |
| devise :registerable, # handles signing up users through a registration process, also edit/destroy account. | |
| :rememberable, # "Remember me" from a cookie | |
| :trackable # Tracks sign in count, timestamps and IP address | |
| property :id, Serial | |
| # Each user may log in using different methods: | |
| has n, :authentications | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment