We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9a9b05a + d2bc1b9 commit be9aa73Copy full SHA for be9aa73
guides/source/active_record_validations.md
@@ -1156,7 +1156,7 @@ empty string for example.
1156
1157
```ruby
1158
class Topic < ApplicationRecord
1159
- validates :title, length: { is: 5 }, allow_blank: true
+ validates :title, length: { is: 6 }, allow_blank: true
1160
end
1161
```
1162
@@ -1166,7 +1166,7 @@ irb> Topic.create(title: "").valid?
1166
irb> Topic.create(title: nil).valid?
1167
=> true
1168
irb> Topic.create(title: "short").valid?
1169
-=> false # 'short' is not of length 5, so validation fails even though it's not blank
+=> false # 'short' is not of length 6, so validation fails even though it's not blank
1170
1171
1172
### `:message`
0 commit comments