JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources
Controls to disable eager loading
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 2.3k
- Forks
- 546
- PR merge metrics
- No merged PRs in 30d
Description
I have some situations where I'm loading an included resource that lives in a different DB than the primary resource being loaded. AR.includes as it is called in Resource.apply_includes method breaks it. I am avoiding this by overriding apply_includes to skip eager loading for certain resource names, but I have a distaste for overriding more methods than I need to out of concern for long term brittleness of my codebase.
I'd like to add this option to resource associations eager_load: false. Anyone have initial feedback?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Resource.apply_includes and the AR.includes call described in the issue, then inspect how resource associations are defined and processed. Determine the behavior needed for an eager_load: false association and identify or add coverage for resources backed by different databases; done means those associations no longer trigger eager loading while other includes retain their behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100