Make it Rails 4.1 compatible

See rails/rails#13271