gabrielshufelt / Real-Ratings-SOEN-341_Project_F24

0 stars 1 forks source link

Add `sex` field to Users and implement `honorifics` method #35

Closed gabrielshufelt closed 3 weeks ago

gabrielshufelt commented 3 weeks ago

Description:
We want to enhance the User model by adding a sex field and implementing a method to return honorifics based on the user's selected sex.

Requirements:

  1. Add a new sex field to the User model, with the following options:
    • Male
    • Female
    • Other
  2. Update the registration form to include a required dropdown for users to select their sex.
  3. Ensure that a user must choose one of these options to successfully register.
  4. Implement an honorifics method in the User model, which will return an appropriate honorific string based on the user's sex:
    • Male: "Mr."
    • Female: "Ms."
    • Other: "Mx."
  5. Ensure that calling User.last.honorifics in the rails console will return the appropriate honorific for the most recently created user.

Acceptance Criteria: