title: How to mix-in Paperclip has_attached_file method in Ruby?
body: <p>Paperclip provides the following code:</p>
  
  <pre><code>has_attached_file :image, 
  ...
  ...
  </code></pre>
  
  <p>which is duplicated across several models.</p>
  
  <p>Extracting to a module:</p>
  
  <pre><code>module AttachedImage
    include Paperclip::Glue
  
    has_attached_file :image, 
    ...
    ...
  </code></pre>
  
  <p>raises <code>Exception encountered: #&lt;NoMethodError: undefined method 'class_attribute' for AttachedImage:Module&gt;</code> exception.</p>
  
  <p>What does this mean? How to mix-in Paperclip <code>has_attached_file</code> code? Is there a better way to eliminate duplication?</p>