Prev | Current Page 533 | Next

Kevin Marshall, Chad Pytel, and Jon Yurek

"Pro Active Record: Databases with Ruby and Rails"


invalid?(attribute)
This method returns true if the specified attribute has had any errors added for it.
length()
This method is an alias for size().
on(attribute)
This method returns the error, or errors, that have been added for the specified attribute. If no
errors have been added, nil will be returned. If only one error has been added, a String will be
returned. If more than one error has been added, an Array of the errors will be returned. This
method is also aliased as [].
on_base()
on_base returns the error, or errors, that have been added directly on the Active Record class
(as opposed to onto a specific attribute). If no errors have been added, nil will be returned. If
only one error has been added, a String will be returned. If more than one error has been
added, an Array of the errors will be returned.
size()
size returns the number of errors that have been added to the specified Active Record object,
which includes all of the individual errors on each attribute, as well as errors added directly to
object itself.


Pages:
521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545