Prev | Current Page 496 | Next

Kevin Marshall, Chad Pytel, and Jon Yurek

"Pro Active Record: Databases with Ruby and Rails"

This method
does not cause the Active Record object to be saved.
APPENDIX ?–  ACTIVE RECORD METHODS IN DETAIL 226
decrement!(attribute)
This method also decreases the specified attribute by one. If the attribute is nil, the attribute
will be initialized to zero before being decremented (resulting in a value of -1). This method
does save the changed attribute to the database. However, when the attribute is saved, the object
validations are not run, allowing the attribute to be saved even if the full object is not valid.
destroy()
destroy deletes the database record for this Active Record object and freezes the attributes of
the object.
eql?(object_to_compare)
eql? returns true if the specified object is equal to the current Active Record object or false if
it is not. This method simply calls the equals operator (==).
freeze()
This method freezes the attributes of the Active Record object so that they cannot be changed.
Also, it allows you to access the associations of an object, even after the object has been
destroyed.


Pages:
484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508