title: SerializationError Rails ActiveJob Time and Date
body: <p>Anyone know of a clean way to avoid the <code>ActiveJob::SerializationError</code> that occurs when trying to serialize a <code>Date</code> or <code>Time</code> object?</p>
  
  <p>The two solutions I've had so far are to:</p>
  
  <ul>
  <li>Call Marshal/JSON/YAML <code>dump</code> when loading the arguments and then <code>load</code> back in the Job (which sucks because I need to monkey patch the mailer job)</li>
  <li>Monkey patch <code>Date</code> and <code>Time</code> like so:</li>
  </ul>
  
  <p>/lib/core_ext/time.rb</p>
  
  <pre><code>class Time
  
    include GlobalID::Identification
  
    def id
      self.to_i
    end
  
    def self.find(id)
      self.at(id.to_i)
    end
  end
  </code></pre>
  
  <p>/lib/core_ext/date.rb</p>
  
  <pre><code>class Date
  
    include GlobalID::Identification
  
    def id
      self.to_time.id
    end
  
    def self.find(id)
      Time.find(id).to_date
    end
  end
  </code></pre>
  
  <p>Which also sucks. Anyone have a better solution?</p>