Prev | Current Page 423 | Next

Kevin Marshall, Chad Pytel, and Jon Yurek

"Pro Active Record: Databases with Ruby and Rails"

We covered the details
of picking proper table and key names and overriding the preferred defaults in Chapter 7.
Various methods: Just below the methods for guessing table and key names are a variety of
simple methods that add a lot of nice little features, such as the abilities to get a list of
columns from a table, check if a given table exists in the database, and sanitize SQL statements
(which, interestingly, just defers the sanitization to the connection.quote method).
Benchmarking: Benchmarking is important to any database application that expects to
have a significant number of statements executed throughout its life cycle. Here, you can
see that benchmarking really only occurs when the log level of the logger matches the
application??™s log level. We cover benchmarking in detail in Chapter 6.
Scope: Handling scope is an interesting logic problem from a programming point of view,
so it??™s well worth examining the source code to see just how Active Record implements
support for scoping. We cover the details of Active Record scope in Chapter 2.


Pages:
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435