Pro ActiveRecord for Ruby helps you take advantage of the full power of your database engine from within your Ruby programs and Rails applications. It walks you through every step from the basics of getting and installing the ActiveRecord library to working with legacy schema to using features specific to each of today's most popular database engines, including Oracle, MS SQL, and MySQL. You'll come to a deep understanding of ActiveRecord that will enable you to truly exploit all that Ruby, Rails, and your chosen database platform have to offer.
Right at the start of Pro Active Record the authors address a possible problem some may have with it: that there’s not enough in Active Record to warrant a full book. They point out that the basics are well covered as sections elsewhere but that this is the first book to really dig into working with legacy schema and other ‘advanced’ uses. That’s fair enough, but after reading the book I am still left with the question of why, then, they dedicate the first half to covering ActiveRecord’s most basic concepts?
Judging from postings on the rails email list, there’s certainly a lot of confusion about ActiveRecord, associations, observers, how to work with legacy table names and primary keys, and so on. But in a book with a title prefix of “Pro” I was expecting to jump straight into the nitty gritty of topics like compound/composite primary keys and performance tuning, probably with some real world examples, and maybe with a serious exploration of AR’s internals. As it is, such topics only get a quick treatment in the final chapter (the compound/composite primary keys section is a paragraph referring users to http://compositekeys.rubyforge.org).
It’s almost always instructive reading other developers’ code and it would be unfair to claim that I didn’t spot a couple of tips that may prove useful, but they were passing things. And sometimes I found myself wondering what happened to the tech review process, particularly in the coverage of the has_one association, where not only is the variable naming confusing, but they seem to be calling the each method on a single ActiveRecord instance.
I’m left wondering what the audience is for this book. The title and blurbs suggest it’s pitched at people who want to go deeper into ActiveRecord than they have before, but the content is better suited for someone with some database experience who wants to pick up ActiveRecord to write some scripts. As it is, if you’ve worked with ActiveRecord before your time will be better spent writing plugins and exploring the internals for yourself, and if you’ve not you’ll get most of the same material from a decent Rails book and some time exploring.
Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at apress, amazon US, amazon UK and all sorts of other places.
Pro Active Record: Databases with Ruby and Rails is a technically focused guide designed to deepen a developer’s understanding of database interaction within Ruby and Rails environments. Kevin Marshall moves beyond surface level ORM usage and explores how ActiveRecord can be leveraged to maximize the underlying power of major database engines.
Across 304 pages, the book covers foundational setup, integration with existing or legacy schemas, and database specific features for platforms such as Oracle Database, Microsoft SQL Server, and MySQL. This broader scope distinguishes it from beginner Rails guides that focus primarily on conventions without addressing engine level nuance.
The strength of the book lies in its effort to bridge abstraction and control. Rather than treating ActiveRecord as a black box, Marshall encourages developers to understand the SQL layer beneath it. For programmers working in enterprise environments or maintaining legacy systems, this deeper perspective can be particularly valuable.
Given its original publication date of 2007, some sections reflect the state of Ruby and Rails at that time. However, the conceptual discussions around database interaction, schema design, and ORM behavior remain useful for developers seeking foundational clarity.
This book is best suited for intermediate Ruby and Rails developers who want stronger command over database behavior rather than relying solely on framework conventions.
Firstly, this book isn't terribly "pro", really the only audience that can benefit from it would be folks with lots of DBMS experience, lots of SQL experience, lots of ORM experience, but no ActiveRecord experience. I'll grant that it goes more in-depth than the "activerecord chapter" in your typical rails book.
ActiveRecord definitely has enough going on with it to justify an entire book about it, especially when you're new to ruby and trying to make a web application. This book covers a lot of that material, but not well. A lot of things that should be in charts are in prose, and there are a lot of cases where there are 5 options to a method, and they'll cover 4 of them. Why not just go ahead and be comprehensive? Also, most of the "Note"s (remember-me's) that they cover are pretty easily made into non-issues with some really minor integration tests. I mean, have these guys heard of in-memory dbs and integration tests?