Fix for Rails 3.x