Skip to content

Commit be9aa73

Browse files
authored
Merge pull request rails#54093 from hachi8833/fix_validation_guide2
2 parents 9a9b05a + d2bc1b9 commit be9aa73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guides/source/active_record_validations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ empty string for example.
11561156

11571157
```ruby
11581158
class Topic < ApplicationRecord
1159-
validates :title, length: { is: 5 }, allow_blank: true
1159+
validates :title, length: { is: 6 }, allow_blank: true
11601160
end
11611161
```
11621162

@@ -1166,7 +1166,7 @@ irb> Topic.create(title: "").valid?
11661166
irb> Topic.create(title: nil).valid?
11671167
=> true
11681168
irb> Topic.create(title: "short").valid?
1169-
=> false # 'short' is not of length 5, so validation fails even though it's not blank
1169+
=> false # 'short' is not of length 6, so validation fails even though it's not blank
11701170
```
11711171

11721172
### `:message`

0 commit comments

Comments
 (0)