public Method

Validations.valid?

Checks for errors on an object (i.e., is resource.errors empty?).

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

Source Code

# File active_resource/validations.rb, line 279
def valid?
  errors.empty?
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.