Class: User
- Inherits:
-
CouchRest::Model::Base
- Object
- CouchRest::Model::Base
- User
- Includes:
- SRP::Authentication
- Defined in:
- app/models/user.rb
Class Method Summary collapse
- .find_by_param(login) ⇒ Object
-
.valid_attributes_hash ⇒ Object
valid set of attributes for testing.
Instance Method Summary collapse
Class Method Details
.find_by_param(login) ⇒ Object
20 21 22 |
# File 'app/models/user.rb', line 20 def find_by_param(login) return find_by_login(login) || raise(RECORD_NOT_FOUND) end |
.valid_attributes_hash ⇒ Object
valid set of attributes for testing
25 26 27 28 29 |
# File 'app/models/user.rb', line 25 def valid_attributes_hash { :login => "me", :password_verifier => "1234", :password_salt => "4321" } end |
Instance Method Details
#salt ⇒ Object
41 42 43 |
# File 'app/models/user.rb', line 41 def salt password_salt.hex end |
#to_json(options = {}) ⇒ Object
37 38 39 |
# File 'app/models/user.rb', line 37 def to_json(={}) super(.merge(:only => ['login', 'password_salt'])) end |
#to_param ⇒ Object
33 34 35 |
# File 'app/models/user.rb', line 33 def to_param self.login end |
#verifier ⇒ Object
45 46 47 |
# File 'app/models/user.rb', line 45 def verifier password_verifier.hex end |