title: Calling Mixpanel API only in production Rails environment
body: <p>I am currently using mixpanel with the default <a href="http://rubydoc.info/gems/mixpanel/0.8.1/frames" rel="nofollow">'mixpanel' gem</a> for analytics and have some calls set up in my controllers.  I would like those calls to only run in the production environment.  Is the best way to do this something like this for every call:</p>
  
  <pre><code>@mixpanel.track_event("Job Accepted", {:user=&gt; current_user.id}) if RAILS_ENV == 'production'
  </code></pre>
  
  <p>Seems like overkill, but I'm struggling to think of a better solution.  Any help would be great!</p>