Soon after hearing that version 2.0 of the Ruby on Rails web development framework had been released, i decided to try out my pet project RailsCollab to see if it would work properly in the new release.
Sadly it did not, though it didn’t take too long to fix everything. To summarise:
- I still used a few deprecated functions and parameters, such as link_to_url, @request, start_form_tag, and so on. Changing references to their new counterparts solved this issue.
- Two plugins i use, “enum-column” and “paginating_find” broke. I had to modify the code for these as illustrated below.
- A new script, “script/performance/request” was added to i naturally had to add it to my svn repository
- The default session container changed to cookies, so i had to fill in “config.action_controller.session” in config/environment.rb
- “config.breakpoint_server = true” had to be removed from my development environment
- Mongrel decided to through a wobbler and stop working, so i had to do a reinstall of it
How to update
Initially i was a bit confused regarding the correct update procedure, however i believe the following commands should suffice:
sudo gem update rails -y
# In your app's directory
rake rails:update
enum-column fix
Since database plugins for Rails have been seperated from the core, enum-column runs into a bit of trouble as it assumes the plugins for MySQL and PostgreSQL are loaded when in most cases they are not.
In addition i couldn’t even get the PostgreSQL plugin working, though this wasn’t so much an issue as i only use the plugin to support the initial database schema from ActiveCollab.
So in “vendor/plugins/enum-column/plugins/enum-column/init.rb”, change the following:
require 'enum/mysql_adapter'
require 'enum/postgresql_adapter'
To this:
require 'enum/mysql_adapter' if (ActiveRecord::ConnectionAdapters.const_defined? :MysqlAdapter)
# require 'enum/postgresql_adapter'
paginating_find fix
This one is rather simple. In “vendor/plugins/paginating_find/lib/paginating_find.rb”, look for this line:
options = extract_options_from_args!(args)
And change it to this:
options = args.extract_options!
Initial impressions
I was very impressed to find that RailsCollab was notably faster in development mode. I suspect this is due to a combination of that fancy query caching system and of course the change to cookie-based storage as the default session storage system.
Apart from the minor hiccups i had when updating RailsCollab, i’ve not had any more issues with Rails 2.0. For my future projects, i will definitely be targeting Rails 2.0.
