You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...unfortunately it expects the JSON to appear in a certain way though, ie:
{
"id": 1,
"employees": [],
"articles": [],
}
...so in your example a bit of a workaround may be required. 🤔
You could either massage the incoming JSON in Faraday before passing it on to Spyke to fit the format above, or perhaps use a class to join them together:
Hello, is there a way to make the association definition to pick up nested resources from the JSON payload?
Let's say we have a
Shop
model withArticles
andEmployees
, but the JSON payload when fetching theShop
is the following :How could one define the
has_many
such thatshop.employees
returns the Spyke association?The text was updated successfully, but these errors were encountered: