Conversation
|
|
||
| context 'when there are no users' do | ||
| it 'returns n/a' do | ||
| allow(User).to receive_message_chain(:joins, :group, :pluck).and_return([]) |
MrNagoo
commented
Aug 12, 2024
|
|
||
| def user_days_proofed_to_suspension_avg | ||
| user_data = User.where(uuid: data[Events::SUSPENDED_USERS]).joins(:profiles). | ||
| where.not(profiles: { verified_at: nil }). |
Contributor
Author
There was a problem hiding this comment.
Ensure that profile is proofed.
MrNagoo
commented
Aug 12, 2024
| return 'n/a' if user_data.empty? | ||
|
|
||
| difference = user_data.map { |profiled_at, suspended_at| suspended_at - profiled_at } | ||
| (difference.sum / difference.size).seconds.in_days.round(2) |
Contributor
Author
There was a problem hiding this comment.
no point of day conversion function with rails.
MrNagoo
commented
Aug 12, 2024
| before do | ||
| user6.destroy | ||
| user7.destroy | ||
| end |
Contributor
Author
There was a problem hiding this comment.
would be nice if there was a skip_let [list] macro.
Contributor
There was a problem hiding this comment.
you could override by doing
let(:user6) { nil }
let(:user7} { nil }and the users wouldn't get created
Contributor
Author
There was a problem hiding this comment.
Yeah that works! I didn't think that would happen in that order.
Contributor
Author
There was a problem hiding this comment.
@zachmargolis I had to add a changelog commit so I made the let changes.
zachmargolis
approved these changes
Aug 12, 2024
…ment metrics to lg99 report
…ment metrics to lg99 report
zachmargolis
approved these changes
Aug 12, 2024
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🎫 Ticket
Link to the relevant ticket:
LG-12819
🛠 Summary of changes
Added 5 new metrics to the LG-99 report for team Judy.
📜 Testing Plan
Provide a checklist of steps to confirm the changes.