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

Suppression des scopes auto-créés par l'énumération 'status' dans 'schooling' #1226

Merged
merged 1 commit into from
Nov 19, 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
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