Since there??™s only one Ruby file located in the lib directory, called
active_record.rb, that seems like a good place to start. Load active_record.rb into your favorite
editor, and let??™s walk through some of the most interesting tidbits of code.
Walking Through active_record.rb
The first thing you should notice in active_record.rb is that Active Record requires the
Active Support library. Active Support was primarily built, as was Active Record, for use with
the Ruby on Rails framework, and according to its documentation, it ???is a collection of various
utility classes and standard library extensions that were found useful for Rails.???
Probably the most important thing Active Support adds to Active Record is the inflection
support for pluralization of table names. There are, of course, a number of other things
Active Support adds, but going into detail about each is outside of the scope of this book.
However, we do recommend that you take some time to browse the Active Resource documentation
or source code. It can only help to improve your overall knowledge about how things
work within your Ruby and Active Record programs.
Pages:
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429