intertwingly

It’s just data

Rails 2.3RC2


David Heinemeier Hansson: The past month has seen a flurry of activity getting Rails 2.3 solid. We think we’ve ironed out all the major kinks now, but just to be sure, we’re running one last release candidate before it heads off to the presses.

This release candidate looks much better than the last one.

The Agile Web Development with Rails book has always been chock full of executable and tested code.  With this edition, I’ve taken this one half-step further.  I have a script and data that will run the majority of the executable examples from them book and capture the output: compare 2.2 vs 2.3RC2.  If there is a next edition and if I’m part of it, I plan to take this to the next level and have the output be self-checking and hopefully a part of the Rails team’s regression test suite.

As with every release, there are changes to the generators which affect this book.  For example, Rails 2.2 will generate controllers with lines like these:

@users = User.find(:all)

And the book contains the suggestion that that particular line be modified to look like the following:

@users = User.find(:all, :order => :name)

Now consider what happens when a user who tries out Rails 2.3 and sees the following instead:

@users = User.all

I suspect that many will follow the instructions, and assume that what the book is trying to tell them is that .all must be converted into a .find if you wish to order the results.  This simply isn’t true, as the following works just fine with Rails 2.3:

@users = User.all(:order => :name)

This is a never ending battle.  Rails is evolving at a rapid rate, as are the best practices.  So with this edition we have added a reference to this site which will contain a list of changes that affect the book.  At the moment, the 2.3 page is empty, and that’s because (a) 2.3 isn’t final just yet, and (b) I haven’t seen the final version of the book so I don’t yet know precisely what page number any particular section of the book will end up on.  But if you scan that script for $RC you can see the adaptations that are already required to go from 2.2 to 2.3RC2.