Class: User
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#password_confirmation ⇒ Object
Returns the value of attribute password_confirmation.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
14 15 16 |
# File 'lib/lokka/user.rb', line 14 def password @password end |
#password_confirmation ⇒ Object
Returns the value of attribute password_confirmation.
14 15 16 |
# File 'lib/lokka/user.rb', line 14 def password_confirmation @password_confirmation end |
Class Method Details
.authenticate(name, pass) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/lokka/user.rb', line 28 def self.authenticate(name, pass) current_user = first(:name => name) return nil if current_user.nil? return current_user if User.encrypt(pass, current_user.salt) == current_user.hashed_password nil end |
Instance Method Details
#admin? ⇒ Boolean
35 36 37 |
# File 'lib/lokka/user.rb', line 35 def admin? == 1 end |