Folks, I've never used update_or_create() before, and I'm getting a weird problem. The select ... for update doesn't look right to me, and it's not detecting that this is an update instead of a create. The query I'm getting is:
SELECT `foodinspection_dev`.`header_temp`.`inspectionID`,
`foodinspection_dev`.`header_temp`.`prevInspectionID`,
`foodinspection_dev`.`header_temp`.`foodServiceID`,
... (All the fields in the table)
FROM `foodinspection_dev`.`header_temp`
WHERE (`foodinspection_dev`.`header_temp`.`date` IS NULL AND `foodinspection_dev`.`header_temp`.`email` = '[email protected]' AND `foodinspection_dev`.`header_temp`.`foodServiceID` = 762 AND `foodinspection_dev`.`header_temp`.`inspectionID` = 4159 AND `foodinspection_dev`.`header_temp`.`inspectorID` = 58 AND `foodinspection_dev`.`header_temp`.`manager` = 'Kyle New' AND `foodinspection_dev`.`header_temp`.`obsB` = 1 AND `foodinspection_dev`.`header_temp`.`obsC` = 0 AND `foodinspection_dev`.`header_temp`.`obsD` = 0 AND `foodinspection_dev`.`header_temp`.`obsL` = 0 AND `foodinspection_dev`.`header_temp`.`obsO` = 0 AND `foodinspection_dev`.`header_temp`.`prevInspectionID` IS NULL AND `foodinspection_dev`.`header_temp`.`serB` = 1 AND `foodinspection_dev`.`header_temp`.`serC` = 0 AND `foodinspection_dev`.`header_temp`.`serD` = 0 AND `foodinspection_dev`.`header_temp`.`serL` = 1 AND `foodinspection_dev`.`header_temp`.`serO` = 0 AND `foodinspection_dev`.`header_temp`.`status` = 1 AND `foodinspection_dev`.`header_temp`.`timeIn` = '13:25:00.000000' AND `foodinspection_dev`.`header_temp`.`timeOut` = '13:25:00.000000' AND `foodinspection_dev`.`header_temp`.`inspectionType` = 2)
LIMIT 21
FOR UPDATE```
I would expect the `where` of that query to just be ``foodinspection_dev`.`header_temp`.`inspectionID` = 4159`, since that's the pkey