Fix Rails 3 support