title: memcached as an Object store in Rails
body: <p>I am using Memcached as an Object Store with my Rails application where I store search results which are User objects in memcached</p>
  
  <p>Now when I fetch the data out I get the Memcached Undefined Class/Module Error. I found a solution for this problem in this blog </p>
  
  <p><a href="http://www.philsergi.com/2007/06/rails-memcached-undefinded-classmodule.html" rel="noreferrer">http://www.philsergi.com/2007/06/rails-memcached-undefinded-classmodule.html</a></p>
  
  <pre><code> before_filter :preload_models
    def preload_models
      Model1
      Model2
    end
  </code></pre>
  
  <p>which recommends pre-loading the models before hand. I would like to know if there is a more elegant solution to this problem and are there any drawbacks in using the preloading technique.</p>
  
  <p>Thanks in advance</p>