title: Dynamically create an escaped constant (Ruby on Rails)
body: <p>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...</p>
  
  <pre><code>def make_constant(type)     
    "::"+"#{type}".singularize.camelize.constantize
  end
  </code></pre>
  
  <p>When I try some thing like</p>
  
  <p><code>make_constant("MyModel")</code> the result should be a constant of: </p>
  
  <pre><code>::MyModel
  </code></pre>
  
  <p>However, I get and error:</p>
  
  <blockquote>
    <p>TypeError (no implicit conversion of Class into String)</p>
  </blockquote>