Skip to content

Commit

Permalink
Suppression des scopes auto-créés par l'enumérateur 'status' dans 'sc…
Browse files Browse the repository at this point in the history
…hooling'
  • Loading branch information
tnicolas1 committed Nov 19, 2024
1 parent 4a32f3e commit a8643a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/schooling.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Schooling < ApplicationRecord # rubocop:disable Metrics/ClassLength
has_one_attached :attributive_decision
has_one_attached :abrogation_decision

enum :status, { student: 0, apprentice: 1, other: 2 }, validate: { allow_nil: true }
enum :status, { student: 0, apprentice: 1, other: 2 }, scopes: false, validate: { allow_nil: true }

belongs_to :student
belongs_to :classe
Expand Down
2 changes: 1 addition & 1 deletion spec/models/student/mappers/csv_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
end

it "assumes students have the right status" do
expect { mapper.new(normal_payload, establishment.uai).parse! }.to change(Schooling.student, :count)
expect { mapper.new(normal_payload, establishment.uai).parse! }.to change(Schooling.where(status: 0), :count)
end
end

0 comments on commit a8643a4

Please sign in to comment.