Skip to content

Commit 574ea20

Browse files
Merge pull request rails#49758 from MatElGran/patch-1
Clarify ActiveModel::SecurePassword maximum password length [ci skip]
2 parents ca5132b + 796eb66 commit 574ea20

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

guides/source/active_model_basics.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ The following validations are added automatically:
527527

528528
1. Password should be present.
529529
2. Password should be equal to its confirmation (provided `XXX_confirmation` is passed along).
530-
3. The maximum length of a password is 72 (required by `bcrypt` on which ActiveModel::SecurePassword depends)
530+
3. The maximum length of a password is 72 bytes (required as `bcrypt`, on which
531+
ActiveModel::SecurePassword depends, truncates the string to this size before encrypting it).
531532

532533
#### Examples
533534

0 commit comments

Comments
 (0)