Module: Devise::Models::Encryptable::ClassMethods
- Defined in:
- lib/devise/models/encryptable.rb
Instance Method Summary collapse
-
#encryptor_class ⇒ Object
Returns the class for the configured encryptor.
- #password_salt ⇒ Object
Instance Method Details
#encryptor_class ⇒ Object
Returns the class for the configured encryptor.
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/devise/models/encryptable.rb', line 55 def encryptor_class @encryptor_class ||= case encryptor when :bcrypt raise "In order to use bcrypt as encryptor, simply remove :encryptable from your devise model" when nil raise "You need to give an :encryptor as option in order to use :encryptable" else ::Devise::Encryptors.const_get(encryptor.to_s.classify) end end |
#password_salt ⇒ Object
66 67 68 |
# File 'lib/devise/models/encryptable.rb', line 66 def password_salt self.encryptor_class.salt(self.stretches) end |