summaryrefslogtreecommitdiff
path: root/users/app/models
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2013-01-14 11:05:52 -0800
committerazul <azul@riseup.net>2013-01-14 11:05:52 -0800
commitee2ea4ac8f4c6b0c3b09be6ed49e7a1faec7a9c1 (patch)
tree45eb6dcddd743de2b9f999d54751d9d4fc0fcbdd /users/app/models
parent4fd47160e0c43695aada330154f41821099bdda0 (diff)
parent7b323c5dbd7171cf98f69ca159b5aa2174a5d069 (diff)
Merge pull request #15 from leapcode/feature/test-data-with-faker
Test data with faker, using factory girl
Diffstat (limited to 'users/app/models')
-rw-r--r--users/app/models/user.rb16
1 files changed, 5 insertions, 11 deletions
diff --git a/users/app/models/user.rb b/users/app/models/user.rb
index 1798ea4..f20c6ac 100644
--- a/users/app/models/user.rb
+++ b/users/app/models/user.rb
@@ -18,8 +18,8 @@ class User < CouchRest::Model::Base
:if => :serverside?
validates :login,
- :format => { :with => /\A[A-Za-z\d_]+\z/,
- :message => "Only letters, digits and _ allowed" }
+ :format => { :with => /\A[A-Za-z\d_\.]+\z/,
+ :message => "Only letters, digits, . and _ allowed" }
validates :password_salt, :password_verifier,
:format => { :with => /\A[\dA-Fa-f]+\z/, :message => "Only hex numbers allowed" }
@@ -54,17 +54,11 @@ class User < CouchRest::Model::Base
class << self
alias_method :find_by_param, :find
-
- # valid set of attributes for testing
- def valid_attributes_hash
- { :login => "me",
- :password_verifier => "1234ABCD",
- :password_salt => "4321AB" }
- end
-
end
- alias_method :to_param, :id
+ def to_param
+ self.id
+ end
def to_json(options={})
{