Make it working with rails 4.1.0