⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Calling deliver_later for forms instead of deliver_now#16

Merged
davezuckerman merged 1 commit intomainfrom
AP-512-deliver-later
Feb 11, 2026
Merged

Calling deliver_later for forms instead of deliver_now#16
davezuckerman merged 1 commit intomainfrom
AP-512-deliver-later

Conversation

@davezuckerman
Copy link
Contributor

added struct file for affiliate borrow request

moved struct into model for borrow_request

removed borrow_request.rb struct file

Changing doemoff_patron_email_form to use struct similar to affiliate_borrower

Changing stack pass for to use deliver_later

Changed deliver_now to deliver_later for more forms

@davezuckerman
Copy link
Contributor Author

deliver_later needs to be serialized and several of the forms don't have db entries so needed to be reworked a bit. The request_mailer views for several of these use dot notation. I think this approach should work for those. (e.g. AffilliateBorrowRequestForm, SecurityIncidentReportForm)

Copy link
Member

@awilfox awilfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, a few questions on some of the details.

Comment on lines +23 to +25
expect do
@form.submit!
end.to have_enqueued_job(ActionMailer::MailDeliveryJob).with(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have expect { @form.submit! } in other places (included the AffiliateBorrowRequestFormSpec just above this file in the diff). I think we should be consistent with block syntax with these tests.

Copy link
Contributor Author

@davezuckerman davezuckerman Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rubocop complained and said that the format above "expect { @form.submit! }" shouldn't be used for multi line blocks. I don't agree with rubocop though. I think it looks better having be consistent

Comment on lines +73 to +75
expect do
invoice.submit!
end.to have_enqueued_job(ActionMailer::MailDeliveryJob)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, this should probably be expect { invoice.submit! }.to …

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Member

@anarchivist anarchivist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally looks good to me - thank you for taking this on!

added struct file for affiliate borrow request

moved struct into model for borrow_request

removed borrow_request.rb struct file

Changing doemoff_patron_email_form to use struct similar to affiliate_borrower

Changing stack pass for to use deliver_later

Changed deliver_now to deliver_later for more forms

Update request_mailer to work with update to efees which uses deliver_later now

removed ActiveJob::Base.queue_adapter = :test from affiliate_borrow_request_form, already a default
@davezuckerman
Copy link
Contributor Author

@copilot

Copy link

Copilot AI commented Feb 11, 2026

@davezuckerman I've opened a new pull request, #19, to work on those changes. Once the pull request is ready, I'll request review from you.

@davezuckerman davezuckerman marked this pull request as ready for review February 11, 2026 21:15
@davezuckerman davezuckerman merged commit 88afa51 into main Feb 11, 2026
5 checks passed
@davezuckerman davezuckerman deleted the AP-512-deliver-later branch February 11, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants