ruby on rails - How did Uppercase Letters get into the User Emails? -
ruby on rails - How did Uppercase Letters get into the User Emails? -
i have next code in rails 4.1 app:
#user.rb with_options unless: :special_without_email? |u| u.before_save { |user| user.email = email.downcase } end
it makes sure user's email converted lower-case before beingness saved. works in cases tested it. yet somehow users (who not special_without_email) managed save emails uppercase-letters in them. cause of this?
(it's causing errors when check user.find_by(email: )
, doesn't find email, can't save new business relationship either.)
ruby-on-rails validation ruby-on-rails-4 before-save
Comments
Post a Comment