ar-find-in-batches-with-order
ar-find-in-batches-with-order copied to clipboard
Possible edge case when a property_key can't be resolved
Thanks for making this gem, it's super handy! I recently ran into an issue with this line:
https://github.com/nambrot/ar-find-in-batches-with-order/blob/c9639498342ee09d45e5d893b6508ecb4cb1f396/lib/ar-find-in-batches-with-order.rb#L16
we have some code that uses raw SQL and so .orders
returns an empty array. In this case, I think the gem should probably raise RuntimeError
-- without a property_key
a harder-to-diagnose ActiveRecord error occurs: TypeError: nil is not a symbol nor a string
If you agree, I'd be happy to submit a PR.
Please do :)
oh awesome! do you have a preference for a testing framework? I'd like to add a little integration test to validate my fix and was planning to use RSpec unless you have any concerns