Ruby, Rails, Firefox, Anime, Mac
Gregg Pollack of Rails Envy (the guys behind your favorite Ruby on Rails vs everything commercials) asked me recently whether I could provide them with weekly updates of changes on edge Rails for the Rails Envy Podcast (which is often hilarious besides being informative), seeing as I am already keeping up with developments on the Rails trunk while doing my small part contributing to Rails. Of course, I responded with a +1.
The podcast is now available and contains only abbreviated notes about the changes that I’d sent over to Gregg, so here’s the detailed version of changes on edge Rails from the release of Rails 2.0.2 (17 Dec 2007) to the day the podcast was recorded (30 Dec 2007).
A native Mongrel handler has been introduced. This is so that it can be worked on independent of Mongrel‘s release cycle (the Rails handler is currently in the Mongrel codebase). Jeremy Kemper (bitsweat) has already made a minor performance improvement by moving the mutex from the handler itself into the dispatcher. This means that as Rails gets more threadsafe, the Rails team can push the mutex further down so that it’s not a (scary) giant lock (the existing Mongrel Rails handler has a synchronized block around Rails’ dispatcher).
Note: The native mongrel handler is not used by default at this time on edge Rails.
A caching branch has been introduced, targeted for Rails 2.1. Other than being a big refactoring, there’s also native cache key management (e.g.
Product.find(5).cache_key # => "products/5") and memcache integration is also being looked at.
Yup, work on Ruby 1.9 compatibility for Rails continues. Rails is fortunate to have committers and contributors who are so keen on being 1.9-compatible – free performance gains are hard to turn down after all. There’s been lots of patching going on to deal with the changes in Ruby 1.9 (Unicode changes, new syntax, deprecations, etc.).
Yes, the Rails committers and contributors working on 1.9-compatibility are fully aware that Ruby 1.9 is a development release, but nothing’s lost in making sure Rails is compatible with a version of Ruby that will eventually be a production version of Ruby. Besides, I think most of the 1.9-compatibility contributors have a dream that sometime soon, when Ruby 1.9 becomes “stable” enough, we’d be running our Rails applications on Ruby 1.9 for a free performance boost.
Too bad running Rails on Ruby 1.9 is not really possible at the moment since other projects like Mongrel need to be updated for Ruby 1.9 as well, first.
ActionMailer::TestCase) introduced in Rails 2 have a gotcha. This has been fixed quickly by Josh Peek.
class Post < ActiveRecord::Base belongs_to :main_category, :class_name => 'Category' end Post.find(:first, :include => :main_category) # => ActiveRecord::StatementInvalid: Mysql::Error: Unknown column 'posts.category' in 'on clause'
ActiveRecord::Base#from_json), or you are using the JSON format for ActiveResource.
has_manyassociations are no longer loaded unnecessarily in
Please leave any suggestions for improvements you may have – about anything really: format, level of detail, what you’d like to see, whatever. Until next week…