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
Use UpdateUser
class when updating users
#1067
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ def rotate(user:, pii_attributes: nil, profile: nil) | |
|
||
def rotate_email_fingerprint(user) | ||
ee = EncryptedAttribute.new_from_decrypted(user.email) | ||
user.update_columns(email_fingerprint: ee.fingerprint) | ||
UpdateUser.new(user: user, attributes: { email_fingerprint: ee.fingerprint }).call | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it important for this to be Behavior is slightly different but changing this breaks no tests. If we want to revert, I can create a ticket to write tests for this so we know not to change it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't want the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is your suggestion that we revert and write some tests later, or keep as is? Happy to do either. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @monfresh when you say "pick one for consistency", what exactly are you referring to? Totally down with using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that my decision to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool, will revert change here and add tests separately so we don't make this change again! https://github.com/18F/identity-private/issues/1450 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reverted at 6ac6a7b There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What I'm saying is that I think we can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh huh that's interesting, sorry I merged before I saw this comment. I feel like using an update method that does not run validations or callbacks makes sense in some situtations, like this one, but perhaps not all? In general in any rails app I would expect records to be updated with |
||
end | ||
|
||
def rotate_ssn_signature(profile, pii_attributes) | ||
|
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.
Why the change from
Time.zone.now
toTime.current
? I think we should be consistent and stick with one. Looks like we use the former more than the latter.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.
honestly: line length. I saw that we are using them both so thought I'd take the short cut. Seems like usage is kind of 50/50?
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.
Up to you!