ResourceValidations error

I just updated a bunch of deps and something that worked fine before just doesn't right now. I have the following error:
** (EXIT from #PID<0.104.0>) an exception was raised:
** (RuntimeError) Resource `Vigil.Operations.Airline` in relationship `:airline` is not accepted by api `Vigil.Accounts`. Please do one of the following...
** (EXIT from #PID<0.104.0>) an exception was raised:
** (RuntimeError) Resource `Vigil.Operations.Airline` in relationship `:airline` is not accepted by api `Vigil.Accounts`. Please do one of the following...
On my User resource, I have the following relationship:
relationships do
belongs_to :airline, Vigil.Operations.Airline do
api Vigil.Operations
allow_nil? false
end
end
relationships do
belongs_to :airline, Vigil.Operations.Airline do
api Vigil.Operations
allow_nil? false
end
end
It was my understanding that it should be fine if I specify which api this belongs to, am I missing something?
4 Replies
ZachDaniel
ZachDaniel•2y ago
That should be fine, yes. What happens if you delete _build and try again?
richaard0
richaard0OP•2y ago
I tried it but the same thing happens 😕 I tried out a prior version (2.7.1) and it works fine. I think it maybe comes from this commit in particular? Not exactly sure what causes it though https://github.com/ash-project/ash/commit/38ec164e3e048b94139b5a8228e20e2b542d5301
GitHub
improvement: include resource validations by default · ash-project/...
improvement: validate explicit api configurations, with good error messages
ZachDaniel
ZachDaniel•2y ago
🤔🤔🤔 Could it be pointing at a different relationship? The code looks right to me, so my guess is that you’ve got a relationship somewhere else missing the api option
richaard0
richaard0OP•2y ago
I'll take a better look, I might have missed one or made a typo. Thanks again Zach, I'll keep you posted!

Did you find this page helpful?