File tree Expand file tree Collapse file tree 1 file changed +0
-18
lines changed Expand file tree Collapse file tree 1 file changed +0
-18
lines changed Original file line number Diff line number Diff line change @@ -1133,24 +1133,6 @@ person.errors.full_messages
1133
1133
# => ["Name cannot contain the characters !@#%*()_-+="]
1134
1134
```
1135
1135
1136
- An equivalent to ` errors#add ` is to use ` << ` to append a message to the ` errors.messages ` array for an attribute:
1137
-
1138
- ``` ruby
1139
- class Person < ApplicationRecord
1140
- def a_method_used_for_validation_purposes
1141
- errors.messages[:name ] << " cannot contain the characters !@#%*()_-+="
1142
- end
1143
- end
1144
-
1145
- person = Person .create(name: " !@#" )
1146
-
1147
- person.errors[:name ]
1148
- # => ["cannot contain the characters !@#%*()_-+="]
1149
-
1150
- person.errors.to_a
1151
- # => ["Name cannot contain the characters !@#%*()_-+="]
1152
- ```
1153
-
1154
1136
### ` errors.details `
1155
1137
1156
1138
You can specify a validator type to the returned error details hash using the
You can’t perform that action at this time.
0 commit comments