Module: DataMapper::Is::Authenticatable::ClassMethods
- Defined in:
- lib/dm-is-authenticatable/is/authenticatable.rb
Overview
Class methods.
Instance Method Summary collapse
-
#authenticate(attributes) ⇒ DataMapper::Resource?
Finds and authenticates a resource.
Instance Method Details
#authenticate(attributes) ⇒ DataMapper::Resource?
Finds and authenticates a resource.
38 39 40 41 42 43 44 45 |
# File 'lib/dm-is-authenticatable/is/authenticatable.rb', line 38 def authenticate(attributes) password = attributes.delete(:password) resource = self.first(attributes) if (resource && resource.has_password?(password)) return resource end end |