I have a table that is large, and I work for a growing company. We will use find_each or find_each_in_batches, but as our code base grows and the number of hands touching the code increases, I’m concerned that we may risk releasing code that will perform terribly in production. Our test environments do not have millions of records, so we’re unlikely to catch an error until we push to production and see our systems grind to a halt.
I’m wondering if there’s an easy way to force the use of find_each (or find_in_batches) for all queries written against my model. This would be one change we could make and we’d forever catch the mistake at the test phase vs having to always worry that our new guy will write perfectly valid code and we’ll just forget that you can’t use that code on that model.