From cc96c60c4617c09379d5e1ddbefa42407329c19a Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 18 Jul 2013 12:12:07 +0200 Subject: testing all versions of emial identities, emails are now strings --- users/app/models/local_email.rb | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'users/app/models/local_email.rb') diff --git a/users/app/models/local_email.rb b/users/app/models/local_email.rb index 69cba01..1cadc71 100644 --- a/users/app/models/local_email.rb +++ b/users/app/models/local_email.rb @@ -1,25 +1,11 @@ -class LocalEmail - include CouchRest::Model::Embeddable - include Email - - property :username, String - - before_validation :strip_domain_if_needed - - validates :username, - :presence => true, - :format => { :with => /\A([^@\s]+)(@#{APP_CONFIG[:domain]})?\Z/i, :message => "needs to be a valid login or email address @#{APP_CONFIG[:domain]}"} +class LocalEmail < Email +=begin validate :unique_on_server validate :unique_alias_for_user validate :differs_from_login +=end - validates :casted_by, :presence => true - - def email - return '' if username.nil? - username + '@' + APP_CONFIG[:domain] - end def email=(value) return if value.blank? -- cgit v1.2.3