-
Notifications
You must be signed in to change notification settings - Fork 801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add preprocess option to find_in_batches in ActiveRecord adapter #152
Conversation
Sure - I'd be happy to rename it. Given that |
I think |
Sure, I'll add documentation and an integration test. About the name, it can't be |
OK, got it. Then the BTW, one way how to work with the codebase in this case would be something like: Article.__elasticsearch__.class_eval do
def __find_in_batches(*args)
[] # Do whatever here...
end
end All the other models would still have the default |
Documentation added plus a more descriptive test. Hopefully that looks good. |
@barelyknown I'm sorry for letting this brew for such a long time... I'll try to have a look at it next week. Thanks! |
@barelyknown I've retouched the code, tests and examples a bit in 351e3b7, thanks for the patch!, it's a useful feature. |
The need to have a preprocessor was mentioned in this issue => #151
This pull request adds support for a
:preprocess
option for__find_in_batches
that enables the user to specify a method to use to preprocess the batch.The test isn't exactly great, but it does ensure that the preprocessor is getting called when it's defined in the options.
I can add documentation if you're good to merge this.