Skip to Content
Metaprogramming Ruby 2
book

Metaprogramming Ruby 2

by Paolo Perrotta
August 2014
Intermediate to advanced
250 pages
6h 20m
English
Pragmatic Bookshelf
Content preview from Metaprogramming Ruby 2

Chapter 9The Design of Active Record

Active Record is the library in Rails that maps Ruby objects to database records. This functionality is called object-relational mapping, and it allows you to get the best of both the relational database (used for persistence) and object-oriented programming (used for business logic).

In this chapter, as well as the next two, we’ll take a look at the high-level design of Active Record’s source code and how its pieces fit together. We are less interested in what Active Record does than how it does it. All we need is a very short example of mapping a class to a database—just enough to kickstart our exploration of Active Record’s internals.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Ruby Programming Language

The Ruby Programming Language

David Flanagan, Yukihiro Matsumoto
Head First Ruby

Head First Ruby

Jay McGavren
Eloquent Ruby

Eloquent Ruby

Russ Olsen

Publisher Resources

ISBN: 9781941222751Errata Page