summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew <bowmande@gmail.com>2011-11-18 01:32:22 -0500
committerDrew <bowmande@gmail.com>2011-11-18 01:32:22 -0500
commit15016ae68dd2e59ce1b12b0be6e9870d16219569 (patch)
treecf86fa704ad87fe90db951449536c4362e15f8d0
parent26bdeb2107d7d55aa89132d9c060421bd377c9f0 (diff)
downloadgitlab-ce-15016ae68dd2e59ce1b12b0be6e9870d16219569.tar.gz
resolved issue 244 and updated test
-rw-r--r--app/models/user.rb2
-rw-r--r--spec/models/user_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index f6c271467dd..712c7aecb26 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 a22aee75b0d..226365775da 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