From a1d2141b5bc3b03b91fb6ba0ab4ad16728c2f4d7 Mon Sep 17 00:00:00 2001 From: Oreoluwa Akinniranye Date: Tue, 14 Jun 2016 21:04:44 +0100 Subject: [PATCH] fixed error with regex matcher resulting in duplicated users --- app/models/user.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index a7d03d8..d4f3144 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,7 +3,7 @@ class User < ActiveRecord::Base include NewNotification include ZhishiDateHelper include RouteKey - + has_many :comments has_many :questions has_many :answers @@ -13,7 +13,8 @@ class User < ActiveRecord::Base has_many :resource_tags, as: :taggable has_many :tags, through: :resource_tags has_many :activities, foreign_key: :owner_id - EMAIL_FORMAT= /(?[.\w]+@andela).co[m]?\z/ + EMAIL_FORMAT= /(?[.\w-]+@andela).co[m]?\z/ + # /(?[.\w]+@andela).co[m]?\z/ scope :with_statistics, Queries::StatisticsQuery