What is the expected visibility of associationIdKeys and associationKeys
See original GitHub issueBug or question
I have a custom serializer which makes use of associationIdKeys and associationKeys to map the id attribute found in attrs
back to the name of the key which is used to access the associated model. This was broken when these properties were changed to Set instead of Array instances (https://github.com/miragejs/miragejs/pull/151), which is fine, but it makes me wonder if our custom serializer should not be using those fields (they are not prefixed with underscore, but they are also not explicitly documented). Is there a better way to achieve what we are doing. For a very basic example of the type of thing we were doing, consider this snippet:
const customSerializedResult = Object.keys(modelInstance.attrs).reduce((result, currKey) => {
if (modelInstance.associationIdKeys.includes(currKey)) {
// ... get associationKey and retrieve nested model to serialize it
}
// ... handle top level property
});
Is there a different or better way to be doing this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
TAF Decoder - AWC - Terminal Aerodrome Forecasts (TAFs)
A Terminal Aerodrome Forecast (TAF) is a concise statement of the expected ... The expected prevailing visibility is forecast in statute miles and...
Read more >Graphical Hazardous Weather Outlook - Visibility
Graphical Hazardous Weather Outlook - Visibility ; Slight, Patchy (1-20% coverage) visibilities < 1/4 mile in fog or < 1 mile in heavy...
Read more >National Weather Service Instruction 10-813
NWS TAFs consist of the expected meteorological conditions significant to ... Visibility forecast greater than six (6) statute miles.
Read more >Chapter 13: Aviation Weather Services - FAA
VFR Clouds and Weather—This section lists expected sky conditions, visibility, and weather for the next 12 hours and an outlook for the following...
Read more >Low Visibility - FHWA Road Weather Management
Low visibility conditions cause increased speed variance, which increases crash risk. Each year, over 38,700 vehicle crashes occur in fog. Over ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@samselikoff Haven’t had a chance to upgrade and check it yet, but it looks like it should work fine. Thanks so much!!
Released in v0.1.35, let me know if it works for you!
https://github.com/miragejs/miragejs/releases/tag/v0.1.35