Fix for Rails 3.