For example,
descendents of MyApp::Business::Account would appear as MyApp::Business::AccountSubclass.
APPENDIX ?– ACTIVE RECORD METHODS IN DETAIL 224
sanitize_sql(sql_to_sanitize)
This method accepts either an Array or a String. If the argument is a String, the string will be
returned unchanged. If the argument is an Array, this method expects the first element of the
array to be an SQL statement. This SQL statement will be sanitized and the remaining elements
of the array will be interpolated into the SQL statement. These additional elements will also be
sanitized. The following code
sanitize_sql(["last_name = '%s', first_name = '%s'", "Mc'Donald", "Old"])
would return "last_name = 'Mc\'Donald', first_name = 'Old'".
Public Instance Methods
==(object_to_compare)
This method returns true if the object_to_compare is the same as the receiving object or is of
the same Active Record class and has the same id.
[](attribute_name)
This method returns the value of the specified attribute after it has been typecast and is an alias
for the protected read_attribute method of an Active Record class.
Pages:
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504