Fix for rails 4.