def serialize_duration(duration)
      case duration
      when ActiveSupport::Duration
        {value: duration.value, parts: duration.parts}
      else
        duration
      end
    end
def serialize_duration(duration)
      case duration
      when ActiveSupport::Duration
        {value: duration.value, parts: duration.parts}
      else
        duration
      end
    end
We don't want the run_interval to be serialized as a number of seconds.
 1.day is not the same as 86400 (not all days are 86400 seconds long!)