This PR implements the idea that I outlined in the mentioned issue.
I was thinking of moving the logic into its own class (e.g. auto_include_context.custom_preloads.some_method), but that would require to also pass the @models to that instance. So I ended up including the logic in the AutoIncludeContext to keep the memory footprint as low as possible.
Refer to the Readme changes for usage instructions. Please let me know if there's anything should be adjusted (code styling etc.).
Are there any chances that this (as soon as it got merged) could get backported to the 4-x-stable branch in order to use it with Ruby 2.7? Please let me know if there's anything I could do to support that
Referenced Issue: #128
This PR implements the idea that I outlined in the mentioned issue. I was thinking of moving the logic into its own class (e.g.
auto_include_context.custom_preloads.some_method
), but that would require to also pass the@models
to that instance. So I ended up including the logic in theAutoIncludeContext
to keep the memory footprint as low as possible.Refer to the Readme changes for usage instructions. Please let me know if there's anything should be adjusted (code styling etc.).