We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.ignore()
In our app we are working with following user (localch-accounts) resource:
{ "href": "http://api.test/localch-accounts/p62qM5p0NK_qryO52Ze", "id": "p62qM5p0NK_qryO52Ze", ... "language": "de", "created_date": "2015-06-30T09:54:59.858+02:00", "claims": { "href": "http://api.test/localch-accounts/p62qM5p0NK_qryO52Ze/claims", "items": [ { "href": "http://api.test/localch-accounts/p62qM5p0NK_qryO52Ze/claims/A00OhenWd_Z5RWnxDE7mqA", "localch_account": { "href": "http://api.test/localch-accounts/p62qM5p0NK_qryO52Ze" }, "place": { "href": "http://api.test/places/A00OhenWd_Z5RWnxDE7mqA" }, ... }
When fetching the user (localch-accounts) we include the claims and also the place:
User.includes([claims: :place]).find('p62qM5p0NK_qryO52Ze')
Now it could be that a place does not exist anymore and we want to avoid running into a 404 by using .ignore(LHC::NotFound).
.ignore(LHC::NotFound)
User.ignore(LHC::NotFound).includes([claims: :place]).find('p62qM5p0NK_qryO52Ze')
I now would expect that no 404 are raised. But a 404 is raised because of a missing place.
With following references i can achieve the desired behavior but i would also expect this by just using ignore() as described above.
ignore()
User.includes([claims: :place]).references(current_user_references).find('p62qM5p0NK_qryO52Ze') ... def current_user_references [ { claims: { place: { ignored_errors: [LHC::NotFound] } } } ] end
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In our app we are working with following user (localch-accounts) resource:
When fetching the user (localch-accounts) we include the claims and also the place:
Now it could be that a place does not exist anymore and we want to avoid running into a 404 by using
.ignore(LHC::NotFound)
.I now would expect that no 404 are raised.
But a 404 is raised because of a missing place.
With following references i can achieve the desired behavior but i would also expect this by just using
ignore()
as described above.The text was updated successfully, but these errors were encountered: