models: require belong_to associations on service
This commit is contained in:
parent
ce53e219e0
commit
059c147ffc
2 changed files with 3 additions and 2 deletions
|
@ -16,7 +16,7 @@
|
||||||
#
|
#
|
||||||
class Service < ApplicationRecord
|
class Service < ApplicationRecord
|
||||||
has_many :procedures
|
has_many :procedures
|
||||||
belongs_to :administrateur
|
belongs_to :administrateur, optional: false
|
||||||
|
|
||||||
scope :ordered, -> { order(nom: :asc) }
|
scope :ordered, -> { order(nom: :asc) }
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,11 @@ FactoryBot.define do
|
||||||
nom { 'service' }
|
nom { 'service' }
|
||||||
organisme { 'organisme' }
|
organisme { 'organisme' }
|
||||||
type_organisme { Service.type_organismes.fetch(:association) }
|
type_organisme { Service.type_organismes.fetch(:association) }
|
||||||
administrateur { create(:administrateur) }
|
|
||||||
email { 'email@toto.com' }
|
email { 'email@toto.com' }
|
||||||
telephone { '1234' }
|
telephone { '1234' }
|
||||||
horaires { 'de 9 h à 18 h' }
|
horaires { 'de 9 h à 18 h' }
|
||||||
adresse { 'adresse' }
|
adresse { 'adresse' }
|
||||||
|
|
||||||
|
association :administrateur
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue