Add rails 4.x compatibility