fix off-by-one error in orbit.model find_by conditions