diff --git a/app/models/schooling.rb b/app/models/schooling.rb index 8603da8f1..cdb4809e2 100644 --- a/app/models/schooling.rb +++ b/app/models/schooling.rb @@ -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 diff --git a/spec/models/student/mappers/csv_spec.rb b/spec/models/student/mappers/csv_spec.rb index 4ca940246..90872aa89 100644 --- a/spec/models/student/mappers/csv_spec.rb +++ b/spec/models/student/mappers/csv_spec.rb @@ -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