JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources

Controls to disable eager loading

Offen
#484 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Type: Enhancement
Vorherrschende Sprache
Ruby
Sterne
2.3k
Forks
546
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rails, ruby
Bereich
api, backend
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.