title: Model Using Modules in Rails Application
body: <p>I have a model that requires loading external data from an auxiliary source. A number of web services exist that my model can fetch the data from (swappable), but I don't want to create code that will make it difficult to change services (costs significantly differ based on variable and fixed usage and it is likely changing will be required).</p>
  
  <p>I would like to create a driver to perform the interaction (and then create further custom drivers if the service requires switching). Unfortunately, due to the tight coupling of the driver and model, it does not makes sense to extract the code into a plugin or gem. I have extracted all the code into a module (see example), and currently have the code declared above my model.</p>
  
  <pre><code>module Synchronize
    def refresh
      self.attributes = ...
      self.save
    end
  end
  
  class Data &lt; ActiveRecord::Base
    include Synchronize
  end
  </code></pre>
  
  <p>Does Rails (3.0.0) have a convention for storing modules tightly coupled with models? Should I be using a plugin to do this? Is this associated with the 'app/helpers' directory? If not, where is the most appropriate place to store the code? Thanks!</p>