models: require belong_to associations on exercice

This commit is contained in:
Pierre de La Morinerie 2020-07-20 16:42:01 +02:00
parent 51d392a1dc
commit 79fcf5e814

View file

@ -12,7 +12,7 @@
# etablissement_id :integer
#
class Exercice < ApplicationRecord
belongs_to :etablissement
belongs_to :etablissement, optional: false
validates :ca, presence: true, allow_blank: false, allow_nil: false
end