method
valid?
v3.2.13 -
Show latest stable
-
0 notes -
Class: ActiveResource::Validations
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3 (0)
- 2.1.0 (0)
- 2.2.1 (0)
- 2.3.8 (0)
- 3.0.0 (21)
- 3.0.9 (-2)
- 3.1.0 (0)
- 3.2.1 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- What's this?
valid?()
public
Checks for errors on an object (i.e., is resource.errors empty?).
Runs all the specified local validations and returns true if no errors were added, otherwise false. Runs local validations (eg those on your Active Resource model), and also any errors returned from the remote system the last time we saved. Remote errors can only be cleared by trying to re-save the resource.
Examples
my_person = Person.create(params[:person]) my_person.valid? # => true my_person.errors.add('login', 'can not be empty') if my_person.login == '' my_person.valid? # => false