title: Ruby: Execute method in context of base class
body: <p>I have about 20 different <a href="http://edgeguides.rubyonrails.org/active_job_basics.html" rel="nofollow noreferrer">Active Jobs</a> which I now realise are each going to need a <code>before_perform</code> method in which to set <a href="https://stackoverflow.com/questions/17970490/papertrail-info-for-paper-trail-outside-the-context-of-a-controller">PaperTrail content outside the context of the controller</a>.</p>
  
  <p>I was planning on putting this <code>before_perform</code> method in a helper and then including the helper in each of the jobs but I am getting an error:</p>
  
  <blockquote>
    <p>undefined method `before_perform' for MyApp:JobHelpers:Module</p>
  </blockquote>
  
  <p>I am thinking that this is because the module in question is just that, a module and not an Active Job. How can I avoid repeating the same 4 line <code>before_perform</code> method in each of my Active Jobs?</p>
  
  <p><strong>Job_helper:</strong></p>
  
  <pre><code>module MyApp
    module JobHelpers
      before_perform do |job|
        # stuff to do
      end
    end
  end
  </code></pre>
  
  <p><strong>The_job:</strong></p>
  
  <pre><code>require 'my_app/job_helpers'
  
  class TheJob &lt; ActiveJob::Base
    include MyApp::JobHelpers
  
   # Do more stuff
  end
  </code></pre>