Fix a bug for checking JSONAPI::Relationship::ToOne authorization#82
Fix a bug for checking JSONAPI::Relationship::ToOne authorization#82clemoberti wants to merge 1 commit intovenuu:masterfrom
Conversation
I had an error when I wanted to fetch a relationship and managed to fix it like this. I'm not sure if that is the most correct way to do it but it worked for me. Thanks for your efforts!
|
Hi! Thanks for your PR :)
Could you clarify a bit? I'd need to know what the exact error was so I could figure out what this code is fixing. Ideally, I'd like to get a spec case to avoid a similar error from happening in the future, so knowing what error this fixes is crucial 😄 |
|
Yes sure! module Api::V1
class UserResource < BaseResource
has_one :profile
end
end
module Api::V1
class ProfileResource < BaseResource
has_one :user
end
endIf I try to call the following endpoint: I get the following exception: I hope my example makes sense? Do not hesitate if you need me to clarify |
|
Hmm, can you tell me what version of |
|
I'm on both master branches:
|
|
OK, that makes sense. We do not yet support the upcoming |
|
Damn, sorry about that... Yes the errors goes away in the previous version! |
|
Yess, great to hear that! I'm gonna close this issue, and add a link to #64 to notice that there will be trouble heading down this road :) |
I had an error when I wanted to fetch a relationship and managed to fix it like this.
I'm not sure if that is the most correct way to do it but it worked for me.
Thanks for your efforts!