diff options
author | jessib <jessib@leap.se> | 2013-01-14 11:50:54 -0800 |
---|---|---|
committer | jessib <jessib@leap.se> | 2013-01-14 11:50:54 -0800 |
commit | c2f232d994b3ee01ff9d50da1e4f3798df2136f3 (patch) | |
tree | 5b7a11e9aed58357d2a38b248b965cd936de6888 /users/app/models/user.rb | |
parent | d81bf00ecd8bdfcddf50e4881428c917253326fe (diff) | |
parent | ee2ea4ac8f4c6b0c3b09be6ed49e7a1faec7a9c1 (diff) |
Merge branch 'master' into feature/show_user. Added new tests.
Conflicts:
users/test/functional/users_controller_test.rb
Diffstat (limited to 'users/app/models/user.rb')
-rw-r--r-- | users/app/models/user.rb | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/users/app/models/user.rb b/users/app/models/user.rb index 4b6b06c..42900ea 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={}) { |