fix find_ids_in_ranges for tables with custom PKs

Change-Id: I3298f187f3fa4976734ef24b9438f5542ceeeeb7
Reviewed-on: https://gerrit.instructure.com/29493
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>