Fixed for Rails 3