Compatibility with activerecord 4.2