Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save philsof/11df8bd99bef20cb53be to your computer and use it in GitHub Desktop.
Save philsof/11df8bd99bef20cb53be to your computer and use it in GitHub Desktop.
code-review-pair-espezua,superboyblue-active-record-drill-model-a-student-challenge

This is good stuff! Your code passes all of the tests! Here are some notes:

  • Nice handling of full names with 2+ words! Your code can handle any crazy long name that comes its way. Sweet!

  • Nice custom validation method age_more_than_five

  • This may be picky, but FYI: Your regexp for your phone number validation has spaces in it. The best way to reference the space character in a Ruby regexp is \s (although according to this table, the space character will work, as it does in your code). Just keep this in mind for best practices.

  • In your full_name method, you joined the first_name and last_name by putting them into an array, then calling .join on the array. If these objects are both strings, there is a simpler way:

    first_name + " " + last_name

    Here are the docs for + on the Ruby string class.

    Good work!

    -Phil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment