Prepare for rails 4