Files
ch420/app/models/supporter.rb
T
2015-10-06 09:30:35 +02:00

23 lines
755 B
Ruby

class Supporter
include Mongoid::Document
include Mongoid::Timestamps
field :first_name, type: String
field :last_name, type: String
field :street, type: String
field :zip, type: Integer
field :city, type: String
field :email, type: String
field :support, type: String # Indicates the type of support
field :age_category, type: String
validates :first_name, presence: true
validates :last_name, presence: true
validates :street, presence: true
validates :zip, presence: true
validates :city, presence: true
validates :email, presence: true, uniqueness: true
validates :support, presence: true
validates :age_category, presence: true
end