Pro Active Record: Databases with Ruby and Rails (Pro)

by Apress

$39.99
buy from amazon.com
Average Rating: * * * half star -
Sales Rank:339109 (lower is better)
Price Used:$0.19
Shipping:Free Shipping on most orders over $25*
Availability:Usually ships in 24 hours
Label:Apress
Pages:304
Binding:Paperback
Publication Date:2007-09-10
Published By:Apress
ASIN:1590598474
Category:Book

Authors

Editorial Reviews and Product Descriptions

Product Description

Pro Active Record helps you take advantage of the full power of your database engine from within your Ruby programs and Rails applications. ActiveRecord, part of the magic that makes the Rails framework so powerful and easy to use, is the model element of Rails model/view/controller framework. Its an object-relational mapping library enabling you to interact with databases from both Ruby and Rails applications.

Because ActiveRecord is configured with default assumptions that mesh perfectly with the Rails framework, Rails developers often find they hardly need think about it at all. However, if you are developing in Ruby without Rails, or are deploying against legacy databases designed without Rails in mind, or you just want to take advantage of database-specific features such as large objects and stored procedures, you need the in-depth knowledge of ActiveRecord found in this book.

In Pro Active Record, authors Kevin Marshall, Chad Pytel, and Jon Yurek walk 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 todays most popular database engines, including Oracle, MS SQL, MySQL, and more! 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.

Customer Reviews

A bit dry and repetitive... - Reviewed on 2008-02-11
* *

Honestly, you may want to pass on this one! The pragmatic book's coverage on this as well as the online resources should be enough to get you by. There were no aha moments with this one, it is a bit of a dry read, with some repetition. I was hoping to dig deeper into the magic that allows ActiveRecord to learn your table names by introspection with some specific gotchas relating to feature support across the different DBMS. I feel like I have a reasonable resource book to allow me to search for ActiveRecord information in one spot. However it is nowhere near as good as Obie Fernandez's The Rails Way as far as references go. There are sections in there which are too repetitive and which may have been aided by the use of the occasional table (pun not intended!) or two.

There may just not be enough material in here to warrant the expense. However, the idea was good and there may still be hope for a second edition with a bit less repetition and more in-depth discussions.
Great Book With Lots Of Examples - Reviewed on 2007-11-21
* * * * *
2 customers found this review helpful, 1 did not.

I was ecstatic when I heard a book dedicated strictly to Active Record was being written and signed up for a copy right away. As a Java developer with just a little bit of Hibernate experience, Active Record has been my biggest challenge learning ROR (in addition to some of the Ruby language idioms). I've read a lot of the other Rails books (e.g. Prag Programmer series) which also cover Active Record, but not in as much detail as this book. In particular, I found the numerous code examples very useful and easy to understand. The authors provide a lot of "here's the SQL generated by Active Record" which help me better understand the "man behind the curtain".

As some of the other reviews have already stated, the introductory and overview sections of this book are excellent. After that, there is a chapter dedicated to explaining the core features of "Active Record". That helps lay the foundation for the rest of the book which covers more advanced topics. Depending on whether you're working with a new schema or legacy schema, there are a lot of tips to help you successfully use Active Record in your real world application.

Hibernate is Java's ORM equivalent to Rails Active Record. The book "Java Persistence with Hibernate" is a whopping 841 pages. "Pro Active Record" is 280 pages, so it's only fitting that the ROR persistence framework can be explained in 1/3 the number of pages. Don't be discouraged by the size of this book as it packs a lot punch. I currently own almost all the good Ruby / ROR books, but this book is one that I always keep by my side.
Good, but not so "pro". - Reviewed on 2007-11-12
* * * *
5 customers found this review helpful, 1 did not.

Visuals:
Font size and layout are good. Easy on the eyes. Large and frequent sub-headings make it easier to locate information.

Audience:
The book lists it's intended "User level" at "Intermediate-Advanced".

Practicality:
It really depends on what you are expecting. I've been using Rails and ActiveRecord for about 2 years, so I should fit into the target audience. After reading the book I still think it will be a great reference book to have within arm's reach while working with ActiveRecord. To me it will serve as an API to AR. So it will be practical in that sense.

On the other hand, while reading it I never experienced any "aha!" moments where I felt like I learned something new or exciting, which I had hoped for from a "Pro" book.

If you are a beginner (never having used AR) it will definitely save you time (and eye strain) hunting down tutorials on blogs.

Overall:
It's a good Active Record reference & usage tutorial(s). I would have appreciated this book even more when I was first starting to use the Ruby on Rails framework. So if you are a beginner, don't let the "Intermediate - Advanced" user level scare you off. If you are using Rails, even as a beginner, you will probably be using Active Record too. In fact I think this book would probably be better named "Beginning Active Record" instead of "Pro Active Record".

I was kind of surprised when I read the Introduction to the book that it starts off with:

"Is there really enough to talk about in Active Record to fill a whole book?"

"Our answer, then and now, is, "Yes and no""

As an "Intermediate - Advanced" user, that's kind of how I felt at the end of this "Pro" book.

I give the book 4 stars, with the assumption that you go into it with the expectation of "Beginning Active Record".
Disappointing and mis-titled - Reviewed on 2007-10-25
* *
13 customers found this review helpful, 2 did not.

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 a plugin).

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.
Excellent intro and extremely useful for work with legacy databases - Reviewed on 2007-10-04
* * * * *
3 customers found this review helpful, 1 did not.

No fear of the legacy database!

Excellent book overall, but Chapter 7 is what takes the cake for me.
It's generally considered a pain to use ROR with legacy databases, but
K.Marshall et al, show that it is not only doable, but not bad at all.

Excellent examples and explanations, showing code in a step by step approach - starting at the very beginning (what active record is, configuring/installing it, etc...).

At the same time, the style is extremely laid back (at times the authors poke a bit of fun at each other), which is always welcomed when learning something new.

Great book and great choice to include information on getting active record working with legacy databases.
Read More Customer Reviews »
Go To Amazon Product Page

* - See Amazon Product Page for shipping and pricing details.


Book Subjects