Allow backward compatibility for rails versions < 4.2