From 5366c3c7481b7d9f43b2b1ba3d0c8f417821f24d Mon Sep 17 00:00:00 2001 From: pixeldesu Date: Tue, 21 Jul 2015 22:44:14 +0200 Subject: [PATCH] add fake mail validation --- Gemfile | 2 ++ Gemfile.lock | 4 ++++ app/models/user.rb | 1 + 3 files changed, 7 insertions(+) diff --git a/Gemfile b/Gemfile index 9e2ea4e1..f3273c1a 100644 --- a/Gemfile +++ b/Gemfile @@ -66,6 +66,8 @@ gem 'tumblr_client' gem 'foreman' gem 'redis' +gem 'fake_email_validator' + group :development do # require spring 1.3.5 since shit's on fire on my local instance with 1.3.4 (Gem::LoadError) gem 'spring', '~> 1.3.5' diff --git a/Gemfile.lock b/Gemfile.lock index a6873462..468e48f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -115,6 +115,9 @@ GEM factory_girl_rails (4.5.0) factory_girl (~> 4.5.0) railties (>= 3.0.0) + fake_email_validator (1.0.11) + activemodel + mail faker (1.4.3) i18n (~> 0.5) faraday (0.9.1) @@ -496,6 +499,7 @@ DEPENDENCIES devise-async devise-i18n factory_girl_rails + fake_email_validator faker fog fog-aws diff --git a/app/models/user.rb b/app/models/user.rb index d5c6973e..1872ece9 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -38,6 +38,7 @@ class User < ActiveRecord::Base screen_name.strip! end + validates :email, fake_email: true validates :screen_name, presence: true, format: { with: SCREEN_NAME_REGEX }, uniqueness: { case_sensitive: false }, screen_name: true validates :display_name, length: { maximum: 50 }