I am not sure what went wrong as when user registers it shows a undefined method `code' error that points to ' if @user.save' from the users controller under def create. I have looked back at the history of my controller and nothing has changed. Not sure why it is breaking now or how to fix it.
user model:
validates :code, uniqueness: true
validates_format_of :zip_code,
with: /\A\d{5}-\d{4}|\A\d{5}\z/,
message: "should be 12345 or 12345-1234"
:code. Are you sure it exists?