Prev | Current Page 497 | Next

Kevin Marshall, Chad Pytel, and Jon Yurek

"Pro Active Record: Databases with Ruby and Rails"


frozen?()
frozen? returns true if the attributes of this object have been frozen; otherwise, it returns
false.
has_attribute?(attribute)
This method returns true if the specified attribute is in the attribute hash of this object.
hash()
hash delegates to id() in order to allow standard operations on Active Record objects of the
same type and id, for example:
[Acccount.find(1), Account.find(3)] & [Account.find(1), Account.find(4)]
# => [ Account.find(1) ]
id()
The id() method makes it so that an Active Record object??™s primary key attribute is always
available as ar_object.id, even if its name has been overridden. This method is also aliased to
to_param().
id=(value)
This method sets the primary key of this Active Record object. The method is always available,
even if you have overridden the name of the primary key attribute to something besides id.
APPENDIX ?–  ACTIVE RECORD METHODS IN DETAIL 227
increment(attribute)
Increase the specified attribute by one with this method. If the attribute is nil, the attribute
will be initialized to zero before being incremented (resulting in a value of 1).


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