Create relation between Administrateur, Gestionnaire and Procedure
This commit is contained in:
parent
f3d8645426
commit
dc18e7da6f
9 changed files with 35 additions and 5 deletions
|
@ -3,4 +3,7 @@ class Administrateur < ActiveRecord::Base
|
|||
# :confirmable, :lockable, :timeoutable and :omniauthable
|
||||
devise :database_authenticatable, :registerable,
|
||||
:recoverable, :rememberable, :trackable, :validatable
|
||||
|
||||
has_many :gestionnaires
|
||||
has_many :procedures
|
||||
end
|
||||
|
|
|
@ -3,4 +3,6 @@ class Gestionnaire < ActiveRecord::Base
|
|||
# :confirmable, :lockable, :timeoutable and :omniauthable
|
||||
devise :database_authenticatable, :registerable,
|
||||
:recoverable, :rememberable, :trackable, :validatable
|
||||
|
||||
belongs_to :administrateur
|
||||
end
|
||||
|
|
|
@ -3,6 +3,8 @@ class Procedure < ActiveRecord::Base
|
|||
has_many :types_de_champ
|
||||
has_many :dossiers
|
||||
|
||||
belongs_to :administrateur
|
||||
|
||||
validates :libelle, presence: true, allow_blank: false, allow_nil: false
|
||||
validates :description, presence: true, allow_blank: false, allow_nil: false
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue