Module: Sequel::Plugins::SecurePassword
- Defined in:
- lib/sequel/plugins/secure_password.rb
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Class Method Summary collapse
- .blank_string?(string) ⇒ Boolean
-
.configure(model, options = {}) ⇒ Object
Configure the plugin by setting the available options.
Class Method Details
.blank_string?(string) ⇒ Boolean
7 8 9 |
# File 'lib/sequel/plugins/secure_password.rb', line 7 def self.blank_string?(string) string.nil? or string =~ /\A\s*\z/ end |
.configure(model, options = {}) ⇒ Object
Configure the plugin by setting the available options. Options:
-
:cost - the cost factor when creating password hash. Default:
BCrypt::Engine::DEFAULT_COST(10)
-
:include_validations - when set to false, password present and
confirmation validations won’t be included. Default: true
16 17 18 19 20 21 22 |
# File 'lib/sequel/plugins/secure_password.rb', line 16 def self.configure(model, = {}) model.instance_eval do @cost = .fetch(:cost, BCrypt::Engine.cost) @include_validations = .fetch(:include_validations, true) @digest_column = .fetch(:digest_column, :password_digest) end end |