title: Rails saving external event ID from external API for subsequent calls
body: <p>I've been developing on Ruby on Rails for a while and this is the first time I ran into this problem. We're using an external API to allow users to open an account with them. They have an API endpoint for us to use and check account statuses and it has a limit of only 1000 events that will be sent back to us. In order to avoid that limit, we'd have to send over the last event ID that we processed so they will only send back events after that event.</p>
  
  <p>For example, we just processed event with ID <code>10,000</code>. Sending that as a param to their API endpoint will give us back events with ID <code>10,001 or greater</code>.</p>
  
  <p>What is the best way to keep track of this ID? The only way I can think of is to make a model with column <code>external_id</code> and keep updating that one record after everything's been processed. This does not seem like the best way to deal with this to me since I'm creating a new model with only 1 record, which seems like a weird thing to do.</p>
  
  <p>I'm calling their API and processing it in a rake task that runs every 1 minute through a cronjob (using the <code>whenever</code> gem).</p>
  
  <p>I don't mean to be subjective, I just want to know if there are any better way to handle this situation than the one I can think of right now before I go ahead and implement it. Thanks for any suggestions!</p>
  
  <p>EDIT: Here's how their response would look like:</p>
  
  <pre><code>[  
       {  
          "id":1087105,
          "dateTime":"2017-01-03T15:38:58.003Z",
          "payload":"{  
              \"status\":\"PENDING\",
              \"requestId\":\"4ab7f930-cf9f-49c2-9814-3bcc2f29e652\"
          }"
       },
       {  
          "id":1087106,
          "dateTime":"2017-01-03T15:38:58.253Z",
          "payload":"{  
              \"status\":\"INVESTIGATION_SUBMITTED\",
              \"requestId\":\"4ab7f930-cf9f-49c2-9814-3bcc2f29e652\"
          }"
      }
  ]
  </code></pre>
  
  <p>The field I'd need to save is the last <code>"id"</code> in that response, in this case that would be <code>1087106</code>.</p>