Use defined? instead of const_defined?

Using const_defined(:Rails) returns nil, this returns the correct value.