Prev | Current Page 519 | Next

Kevin Marshall, Chad Pytel, and Jon Yurek

"Pro Active Record: Databases with Ruby and Rails"


transaction(start_db_transaction = true) { || . . . }
This method wraps the given block in a database transaction and returns the value of the
block.
update(sql, name = nil)
Execute the given UPDATE SQL statement and return the number of rows that were affected.
Protected Instance Methods
select(sql, name = nil)
Execute the given SELECT SQL statement and return an array of record hashes with the column
names as keys and the column values as values with this method. It raises a NotEmplementedError
by default and must be implemented by the specific database connection adapters.
ActiveRecord::ConnectionAdapters::Quoting
Public Instance Methods
quote(value, column = nil)
This method quotes the given value to help prevent SQL injection attacks. If a column is given,
this method will use the column type to determine how this value should be quoted; otherwise,
it will use the value??™s type to determine the quoting method.
quote_column_name(name)
This method returns a quoted form of the given column name. The method of quoting is
highly database specific, and therefore, this method is typically overridden by the connection
adapter.


Pages:
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531