lib/devise_zxcvbn.rb in devise_zxcvbn-1.1.1 vs lib/devise_zxcvbn.rb in devise_zxcvbn-1.1.2

- old
+ new

@@ -9,16 +9,14 @@ def self.min_password_score @@min_password_score end def self.min_password_score=(score) - if score.is_a?(Integer) && (score >= 0 && score <=4) - if score >= 3 - @@min_password_score = score - else + if (0..4).include?(score) + if score < 3 ::Rails.logger.warn "[devise_zxcvbn] A score of less than 3 is not recommended." - @@min_password_score = score end + @@min_password_score = score else raise "The min_password_score must be an integer and between 0..4" end end end