Fixed bug with Rails 3.2