提交 15016ae6 编写于 作者: D Drew

resolved issue 244 and updated test

上级 26bdeb21
......@@ -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?
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册