title: include Rails.application.routes.url_helpers cause ArgumentError Missing host to link to
body: <p>I'm developing Rails 3.1.1. <br />
  Including url_helpers in Model cause an ArgumentError on saving model.</p>
  
  <pre><code>class Medium &lt; ActiveRecord::Base
    include Rails.application.routes.url_helpers
  
    .
    .
  end
  
  class MediaController &lt; ApplicationController
  
    def create
      @medium = Medium.new(params[:medium])
      @media.save # =&gt; cause ArgumentError
    end
  end
  </code></pre>
  
  <p><strong>ArgumentError (Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true):</strong></p>
  
  <p>Another model which also include url_helper doesn't cause error.<br />
  What's wrong?<br />
  Thanks in advance.</p>