Skip to content

Instantly share code, notes, and snippets.

@zacksiri
Created June 27, 2011 14:58
Show Gist options
  • Save zacksiri/1049029 to your computer and use it in GitHub Desktop.
Save zacksiri/1049029 to your computer and use it in GitHub Desktop.
user Model mongoid document
validates_presence_of :email, :if => :sign_up
validates_presence_of :email, :first_name, :last_name, :add1, :add2, :id_number, :if => :edit_page
validates_uniqueness_of :email , :case_sensitive => true
attr_accessor :edit_page, :sign_up
references_many :transactions, :dependent => :delete, :inverse_of => :user
field :customer_id, type: Integer, default: 0
field :title, type: String
field :first_name, type: String
field :last_name, type: String
field :gender, type: String
field :company, type: String
field :add1, type: String
field :add2, type: String
field :city, type: String
field :country, type: String
field :zip_code, type: String
field :telephone, type: String
field :mobile, type: String
field :fax, type: String
field :email, type: String
field :id_type, type: String
field :id_number, type: String
field :birth_date, type: Date
field :encrypted_password, type: String
field :fb_id, type: String
field :current_sign_in_at, type: Date
field :current_sign_in_ip, type: String
field :last_sign_in_at, type: Date
field :last_sign_in_ip, type: String
field :sign_in_count, type: Integer
field :fb_points , :type => Float, :default => 0.00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment