I need to dynamically create a constant that is escaped out of the current namespace, so I need the '::' in front of my constant. However, when I try the below, I get the below error...
def make_constant(type)
"::"+"#{type}".singularize.camelize.constantize
end
When I try some thing like
make_constant("MyModel")
the result should be a constant of:
::MyModel
However, I get and error:
TypeError (no implicit conversion of Class into String)