Beyond the Active Support requirement, the active_record.rb file really just loads the
various source files that make up the whole of the Active Record library. Many of these files are
self-explanatory, and the details of methods they contain are covered throughout various
parts of this book, so we won??™t repeat that information here. However, there are a few key files
like base.rb, abstract_adapter.rb, and connection_specification.rb that do warrant a little
bit more detailed explanation, so let??™s walk through those now.
CHAPTER 8 ?– ACTIVE RECORD AND THE REAL WORLD 188
Walking Through base.rb
You??™ve probably noticed by now that we??™ve been directly referencing the base.rb file in almost
all of our examples throughout this book with a line like the following:
class Account < ActiveRecord::Base
We use the preceding syntax to define an Active Record model that directly maps to a table
within our database. That line basically says that our new class inherits from the Active Record
module??™s base class. Before we break down that base class, though, let??™s open the source file
and see what we find.
Pages:
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430