Port to rails 4 beta