Fixed unsupported method in rails 4