Skip to content
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

Fix assigning SLC plan 1 #3376

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/models/claim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ class Claim < ApplicationRecord

validates :has_student_loan, on: [:"student-loan"], inclusion: {in: [true, false]}, allow_nil: true
validates :student_loan_plan, inclusion: {in: STUDENT_LOAN_PLAN_OPTIONS}, allow_nil: true
validates :student_loan_plan, on: [:amendment], presence: {message: "Enter a valid student loan plan"}

validates :bank_sort_code, on: [:amendment], presence: {message: "Enter a sort code"}
validates :bank_account_number, on: [:amendment], presence: {message: "Enter an account number"}
Expand Down
7 changes: 6 additions & 1 deletion app/views/admin/amendments/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@
</div>
<div class="govuk-grid-column-two-thirds">
<div class="govuk-form-group">
<%= claim_form.select :student_loan_plan, Claim::STUDENT_LOAN_PLAN_OPTIONS.map { |option| [option.humanize, option] }, {}, { class: "govuk-select" } %>
<%= claim_form.select(
:student_loan_plan,
Claim::STUDENT_LOAN_PLAN_OPTIONS.map { |option| [option.humanize, option] },
{ include_blank: true },
{ class: "govuk-select" }
) %>
</div>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion spec/models/claim_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
expect(claim).not_to be_valid(:amendment)
expect(claim.errors.map(&:message)).to contain_exactly(
"Enter your teacher reference number",
"Enter a valid student loan plan",
"Enter a sort code",
"Enter an account number"
)
Expand Down