Restored Rails 3 compatibility