-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
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
Add some helper methods to be able to get a scim resource #99
Open
DeRRudi77
wants to merge
4
commits into
RIPAGlobal:main
Choose a base branch
from
DeRRudi77:add-helper-methods-in-resource-mixin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e4d6754
Add some helper methods to be able to get a scim resource based on a …
DeRRudi77 3f0dcdf
Merge branch 'main' into add-helper-methods-in-resource-mixin
pond b25da5a
Fix mistakes I made in the conflict resolution
pond a6108c7
Update mixin.rb
pond File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a method comment explaining what it does, in RDoc format, as with all other methods. See lines above line 418 for what's already there. It probably needs to reference the documentation of the #from_scim_patch! method as a "see also" and/or vice versa. Use
bundle exec rake rerdoc
to rebuild RDoc content and view it locally in a web browser to make sure the markup is correct.I do not understand
scim_resource_from_patch
. A patch payload contains an alteration, not the entire resource. It can often contain just a single operation for a single attribute. The method implemented would produce an invalid resource with only patched fields present and other things missing. There are already better ways to retrieve a resource instance and patch it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add it
Will add documentation for it, but in essence it creates a
complete
scim resource based on the original AR object and applies the patches, this is how thefrom_scim_patch!
internally works. I've tested this and always get a complete resource with the patches applied.Would love to see those, can you point me in the right direction? If we have those, we don't need these extractions, I just couldn't find them, nor are they documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pond if possible could you point me towards this?
If I know how to do this, I can possibly close this MR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DeRRudi77 Sorry for delay. I got a bit sick and had no sleep into the week, so just wasn't firing on all cylinders (and am still not, but I'll do my best).
I am wrong about the resource recovery. I had forgotten that the old
#from_scim_patch !
does take a full SCIM representation of the existing model then apply patch operations on top, so the reworked code in the PR isn't just getting the patch parts only.In that case, all we need here is comments in RDoc format on the 80 column wrap limit as elsewhere in this file and then the code itself is good. Tests, however, should be added, please - are you OK doing that? It is hopefully not too hard to take some of the existing mixin
#from_scim_patch !
and do a bit of copy-paste pulling out of subset parts of the tests to cover the new methods, I would think.