The laa-apply-for-legal-aid system is a web service by use for solicitors providing legal aid services to enter applications for legal aid on-line. It asks for details of applicant means (income and assets), and the merits of a case, and gives a decision on whether legal aid can be granted or not, and if so, will push the application through to back-end processes for payment.
With the removal of this hook an inadvertent side effect has been
removed
after_create do
ActiveSupport::Notifications.instrument "dashboard.application_created", id:, state:
end
The calling of the state method in this code means it actually calls
state_machine_proxy method, which creates a state_machine relation
on the application if it does not have one. Its removal therefore opens
up issues both in tests and possibly functioning of the app.
By replacing it with an explicit call to state_machine_proxy we avoid
the issue.
Checklist
Before you ask people to review this PR:
Tests and rubocop should be passing: bundle exec rake
Github should not be reporting conflicts; you should have recently run git rebase main.
What
Initiate state machine after application creation
Link to story
With the removal of this hook an inadvertent side effect has been removed
The calling of the
state
method in this code means it actually callsstate_machine_proxy
method, which creates astate_machine
relation on the application if it does not have one. Its removal therefore opens up issues both in tests and possibly functioning of the app.By replacing it with an explicit call to
state_machine_proxy
we avoid the issue.Checklist
Before you ask people to review this PR:
bundle exec rake
git rebase main
.