title: How do I update all but first and last of records with specific foreign key value in rails?
body: <p>I have a model called <code>AttendanceLog(time-stamp, employee id, and type: check-in, check-out or undefined)</code>.</p>
  
  <p>I am trying to run a daily job that finds the records corresponding to an employee who has an odd number of attendance logs and I want to update all but the first and last <code>attendance_logs</code> to be of type undefined.</p>
  
  <p>Example:</p>
  
  <pre><code>id: 2, logged_at: 9:00, employee_id: 2 
  id: 3, logged_at: 11:00, employee_id: 2
  id: 4, logged_at: 14:00, employee_id: 2
  </code></pre>
  
  <p>Because employee 2 has 3 <code>attendance_logs</code>, I want to modify the ones in between the first and last to be <code>undefined</code> in as less # of queries as possible</p>