begin port to rails 4.1