conditional check whether Rails is defined