const_defined does not work with namespaced models

If history is enabled and a namespaced model gets deleted, this throws a "wrong constant name" error message.

I added the .try just to be extra safe.