summaryrefslogtreecommitdiff
path: root/users/app/models
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-11-23 12:11:11 +0100
committerAzul <azul@leap.se>2012-11-23 15:09:53 +0100
commitee3c9146e4bbe93ec1f00ee45386a82ec4363c4d (patch)
treeec673f97f22c13c19c1f9034dfe88646525bdeae /users/app/models
parent716dc248e940be8bd323a9d92f98785737fc99a0 (diff)
identify user by id so rerendering the form does not use new invalid login
Diffstat (limited to 'users/app/models')
-rw-r--r--users/app/models/user.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/users/app/models/user.rb b/users/app/models/user.rb
index 507eda5..624754b 100644
--- a/users/app/models/user.rb
+++ b/users/app/models/user.rb
@@ -29,9 +29,7 @@ class User < CouchRest::Model::Base
end
class << self
- def find_by_param(login)
- return find_by_login(login) || raise(RECORD_NOT_FOUND)
- end
+ alias_method :find_by_param, :find
# valid set of attributes for testing
def valid_attributes_hash
@@ -42,9 +40,7 @@ class User < CouchRest::Model::Base
end
- def to_param
- self.login
- end
+ alias_method :to_param, :id
def to_json(options={})
{