- Rails 2.3.3 was released yesterday. It is a minor point release but a notable new feature is a faster decoding backend for JSON.
- The Evening with Palm webOS event is tonight at 6:30!
- Braid gotcha be careful when using Braid to checkout a specific branch of a Git repository. If you checkout a repository with Braid, and then later decide that you want to switch to a different branch (i.e. going from master to 2-3-stable with Rails) doing a
braid remove vendor/railsis not sufficient! The reason is when you add a external with Braid it also adds a remote branch in your Git repository. If you re-add the external, the old remote will be reused, even if you specify a different branch. To avoid this, remove the remote in addition to removing the external. To view your remotes run
git remoteand remove a remote with
git remove rm some/remote/name.
Weirdness with using
serialized with Single Table Inheritance in Rails
If you have a class that uses a serialized categories attribute like this:
class Wibble < ActiveRecord::Base serialized :categories end
You can do:
wibble = Wibble.create!(:categories => ['Restaurants', 'Bars']) wibble.reload.categories #=> ['Restaurants', 'Bars']
We’ve experienced problems with this once we added single table inheritance (STI) to the Wibble class.
class Thingie < ActiveRecord::Base end class Wibble < Thingie serialized :categories end
Now, sometimes reloading a Wibble would return the serialized string instead of the array:
wibble = Wibble.create!(:categories => ['Restaurants', 'Bars']) wibble.reload.categories #=> "-- n- Restaurantsn- Barsn"
Our solution, while not ideal, was to move the serialized declaration to the STI superclass.
class Thingie < ActiveRecord::Base serialized :categories end