From cdecef868e6a27b848715f52baba7482f9ceafd2 Mon Sep 17 00:00:00 2001 From: tnicolas1 Date: Tue, 19 Nov 2024 16:17:29 +0100 Subject: [PATCH] =?UTF-8?q?Suppression=20des=20scopes=20auto-cr=C3=A9?= =?UTF-8?q?=C3=A9s=20par=20l'=C3=A9num=C3=A9ration=20'status'=20dans=20'sc?= =?UTF-8?q?hooling'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/schooling.rb | 2 +- spec/models/student/mappers/csv_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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