Rails 3.2 & ruby 1.9 fixes