title: Rails: Overriding const_missing within a module
body: <p>Within my Rails application I have a module defined this way:</p>
  
  <pre><code>module WhateverModule
    class WhateverClass
      ...
    end
  end
  </code></pre>
  
  <p>This file (whatever_class.rb) is located under /app/models/whatever_module</p>
  
  <p><code>const_missing</code> is being overriden by Rails and despite I did some workarounds, involving initializers, I wish I could make it in a better way.</p>
  
  <p>My aim is to get a WhateverModule::Foo (Foo being undefined) to be resolved by a custom <code>const_missing</code> method.</p>
  
  <p>Any help will be greatly appreciated. Thanks in advance!!</p>