rails-models: update error helpers.
This commit is contained in:
parent
9fa340f6c8
commit
c4634c0cf3
|
@ -171,6 +171,14 @@ Validation
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
record.errors.valid? #=> false
|
||||||
|
record.errors #=> { :name => ["can't be blank"] }
|
||||||
|
record.errors.messages #=> { :name => ["can't be blank"] }
|
||||||
|
|
||||||
|
record.errors[:name].any?
|
||||||
|
|
||||||
API
|
API
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue