Make compatible with latest Rails