Skip to content

Instantly share code, notes, and snippets.

@lxcodes
Created June 23, 2011 00:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lxcodes/1041594 to your computer and use it in GitHub Desktop.
Save lxcodes/1041594 to your computer and use it in GitHub Desktop.
User Model
class User
include DataMapper::Resource
timestamps :at
property :id, Serial
property :first_name, String, :required => true
property :last_name, String, :required => true
property :company, String
property :title, String
property :city, String
property :country, String
property :mobile_number, Float
property :email_address, String,
:required => true, :format => :email_address, :unique => true,
:messages => {
:presence => 'We need your email address.',
:is_unique => 'We already have that email.',
:format => 'Doesn\'t look like an email address to me ...'
}
property :shahash, String, :required => true
property :isAttending, Boolean
property :isRegistered, Boolean
belongs_to :event
has n, :entries, :required => false, :constraint => :destroy
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment