question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What is the expected visibility of associationIdKeys and associationKeys

See original GitHub issue

Bug 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:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jackson-deancommented, Feb 24, 2020

@samselikoff Haven’t had a chance to upgrade and check it yet, but it looks like it should work fine. Thanks so much!!

0reactions
samselikoffcommented, Feb 19, 2020

Released in v0.1.35, let me know if it works for you!

https://github.com/miragejs/miragejs/releases/tag/v0.1.35

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found