summaryrefslogtreecommitdiff
path: root/users/app
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-01-14 20:11:49 +0100
committerAzul <azul@leap.se>2013-01-14 20:11:49 +0100
commit8445e6b1a026c8f15fffae7544b84407e9bbce1b (patch)
tree859adf3bac117389595460916f45cfeab49f58cb /users/app
parentf75005e1bc15101f37d377b7ed06f877dc206ee0 (diff)
parentee2ea4ac8f4c6b0c3b09be6ed49e7a1faec7a9c1 (diff)
Merge branch 'master' into feature/fixing-routes-with-api
Diffstat (limited to 'users/app')
-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={})
{