title: Is it possible to define a 'before_save' callback in a module?
body: <p>Is it possible to define a <code>before_save</code> callback in a module? Such that with a class like this:</p>
  
  <pre><code>class Model
    include MongoMapper::Document
    include MyModule
  end
  </code></pre>
  
  <p>and a module like this:</p>
  
  <pre><code>module MyModule
    before_save :do_something
  
    def do_something
      #do whatever
    end  
  end 
  </code></pre>
  
  <p><code>do_something</code> will be called before any <code>Model</code> objects are saved? I've tried it like this but get <code>undefined method 'before_save' for MyModule:Module</code>.</p>
  
  <p>Apologies if it's something simple - I'm new to Ruby and to Rails. </p>