I have a method adjusts an auto-generated email for a user as part of a before_validation
callback:
def update_device_email
binding.pry
self.email = username.gsub(/\s/, '_') + FAKE_EMAIL_SUFFIX
self.email_confirmation = email
end
For some reason though when I hit the binding.pry
call, it shows me a downcased version of the email, which then returns to normal after I call gsub
:
Does anyone know why this may be happening?
You should be checking what the
username
returns prior to the changes being made toself.email