Module: Devise::Models::PasswordHasRequiredContent::ClassMethods

Defined in:
lib/devise/secure_password/models/password_has_required_content.rb

Instance Method Summary collapse

Instance Method Details

#configObject

rubocop:disable Metrics/MethodLength



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/devise/secure_password/models/password_has_required_content.rb', line 135

def config
  {
    REQUIRED_CHAR_COUNTS: {
      length: {
        min: Devise.password_length.min,
        max: Devise.password_length.max
      },
      uppercase: {
        min: password_required_uppercase_count,
        max: LENGTH_MAX
      },
      lowercase: {
        min: password_required_lowercase_count,
        max: LENGTH_MAX
      },
      number: {
        min: password_required_number_count,
        max: LENGTH_MAX
      },
      special: {
        min: password_required_special_character_count,
        max: LENGTH_MAX
      },
      unknown: {
        min: 0,
        max: 0
      }
    }
  }
end