From 7770a4d77833f7cf2c650419fb64f46ed7677d73 Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Fri, 15 Apr 2016 13:49:48 +0300 Subject: [PATCH] Story#117690107 - strip contact email --- app/models/contact.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/contact.rb b/app/models/contact.rb index 3e7ae4fc8..6c61ee698 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -46,6 +46,7 @@ class Contact < ActiveRecord::Base before_validation :to_upcase_country_code before_validation :prefix_code + before_validation :strip_email before_create :generate_auth_info before_update :manage_emails @@ -411,6 +412,10 @@ class Contact < ActiveRecord::Base "#{code} #{name}" end + def strip_email + self.email = email.to_s.strip + end + # what we can do load firstly by registrant # if total is smaller than needed, the load more