Walking Through connection_specification.rb
Active Record connections are ultimately achieved through calling the Base.establish_connection
method that is defined in this module. Each connection requires a set of configuration values
either passed as a Ruby hash variable or loaded through a YAML file in your Rails environment
(assuming you are using Active Record with the Ruby on Rails framework). We covered the
details of each adaptor??™s configuration values in detail in Chapter 1.
Putting It All Back Together
By now, you should be an expert in everything Active Record, or at least have a very solid understanding
of how it all works and where to look in the source code for more details as you need
them. We started this book attempting to make the point that the Active Record library is really
nothing more than Ruby code, and our exploration of the source has just reiterated that statement.
What??™s more important to note, though, is that since it really is nothing more than Ruby
code, you can change and mold it as you see fit.
Pages:
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438