diff --git a/app/models/user.rb b/app/models/user.rb index f6c27146..712c7aec 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -30,7 +30,7 @@ class User < ActiveRecord::Base scope :not_in_project, lambda { |project| where("id not in (:ids)", :ids => project.users.map(&:id) ) } def identifier - email.gsub "@", "_" + email.gsub /[@.]/, "_" end def is_admin? diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index a22aee75..22636577 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -16,7 +16,7 @@ describe User do it "should return valid identifier" do user = User.new(:email => "test@mail.com") - user.identifier.should == "test_mail.com" + user.identifier.should == "test_mail_com" end it "should have authentication token" do