Compatibility fix for Rails 3.1