Skip to content

Commit

Permalink
Added gender validation as a christmas present for our PO
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp-bode committed Dec 13, 2016
1 parent 16ebe11 commit 1839528
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/profile.rb
Expand Up @@ -15,7 +15,7 @@ class Profile < ActiveRecord::Base
validates :user, presence: true
validates_presence_of :first_name, :last_name, :gender, :birth_date, :school, :street_name, :zip_code, :city, :state, :country
validate :birthdate_not_in_future
#validates_inclusion_of :gender, in: POSSIBLE_GENDERS
validates_inclusion_of :gender, in: POSSIBLE_GENDERS


# Returns true if the user is 18 years old or older
Expand Down
6 changes: 3 additions & 3 deletions db/seeds.rb
Expand Up @@ -51,7 +51,7 @@
user: pupil,
first_name: "Karl",
last_name: "Doe",
gender: "männlich",
gender: "male",
birth_date: Date.parse('2000.11.29'),
school: "Schule am Griebnitzsee",
street_name: "Rudolf-Breitscheid-Str. 52",
Expand All @@ -67,7 +67,7 @@
user: teacher,
first_name: "Ernst",
last_name: "Teacher",
gender: "männlich",
gender: "male",
birth_date: Date.parse('1970.1.1'),
school: "Schule am Griebnitzsee",
street_name: "Domstraße 14",
Expand All @@ -83,7 +83,7 @@
user: applicant,
first_name: "Erika",
last_name: "Mustermann",
gender: "weiblich",
gender: "female",
birth_date: Date.parse('1999.08.14'),
school: "Schule am Griebnitzsee",
street_name: "Rudolf-Breitscheid-Str. 52",
Expand Down

0 comments on commit 1839528

Please sign in to comment.