DiffQuiz
WalkthroughSign in with GitHubExplore demo

Review pull requests
by behavior.

Read related code and tests together, even after the next push.

Explore demoWatch walkthrough
DiffQuiz

Pull requests3

Reviews

Settings

CURRENT REVIEW

#482 Resend expired invitations

BEHAVIOR

  • Resend action
  • Expiry window
  • Audit event

Pull requests / #482

#482 Resend expired invitations

Open
ReviewCommits 2Files 4

Behavior: Resend action

Allows an admin to resend an expired invitation, extending its expiry window and recording an audit event.

Related files (3)

  • app/controllers/invitations_controller.rb
  • app/models/invitation.rb
  • spec/requests/invitations_spec.rb
app/controllers/invitations_controller.rb+7−2
38def resend
39 invite = Invitation.find(params[:id])
40- return head :unprocessable_entity unless invite.expired?
41- invite.update!(expires_at: 24.hours.from_now)
42+ return head :unprocessable_entity unless invite.expired?
43+ invite.update!(expires_at: 48.hours.from_now)
44+ AuditEvent.create!(
45+ name: "invitation.resent",
46+ invitation_id: invite.id,
47+ actor_id: current_user.id
48+ )
49end

A clearer path through every pull request

invitations

  • invitations_controller.rb
  • invitation.rb
  • invitations_spec.rb

audit

audit_event.rb

Group related code

Review the right files together, with code and tests organized by behavior.

Before f3a9c2d

After 7d8e4b1

12def expiry_window

13− 24.hours

13+ 48.hours

14end

See what changed

Compare before and after a commit to understand the exact code changes.

Reviewer question

Does this PR correctly resend an expired invitation and extend the expiry window to 48 hours?

  • Yes, it does
  • Not yet

Check understanding

Answer focused questions about the behavior to confirm the change is correct.

Explore DiffQuiz

See how it makes pull request review clearer and more focused.

Explore demo
DiffQuiz
WalkthroughExplore demo