Skip to content

Commit

Permalink
Fix validator abrog rule (#1358)
Browse files Browse the repository at this point in the history
  • Loading branch information
pskl authored Jan 24, 2025
1 parent 5d9ed4f commit b61db93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/asp/payment_request_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def check_da_abrogation # rubocop:disable Metrics/AbcSize
end

other_schoolings = student.schoolings.excluding(payment_request.schooling).to_a.select do |sc|
sc.classe.school_year == SchoolYear.current
sc.classe.school_year == payment_request.schooling.classe.school_year
end

return if other_schoolings.all?(&:abrogated?)
Expand Down
2 changes: 1 addition & 1 deletion spec/models/asp/payment_request_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
describe "#check_da_abrogation" do
context "when student is transferred and schooling needs abrogated attributive decision" do
let(:other_schooling) { instance_double(Schooling, abrogated?: false) }
let(:other_classe) { instance_double(Classe, school_year: SchoolYear.current) }
let(:other_classe) { instance_double(Classe, school_year: classe.school_year) }

before do
allow(student).to receive(:transferred?).and_return(true)
Expand Down

0 comments on commit b61db93

Please sign in to comment.