Fix missing dossier_id on champs inside repetition
This commit is contained in:
parent
7face5e971
commit
8d093bd9ba
4 changed files with 34 additions and 10 deletions
|
@ -1,6 +1,4 @@
|
|||
class Champs::RepetitionChamp < Champ
|
||||
before_save :setup_dossier
|
||||
|
||||
has_many :champs, -> { ordered }, foreign_key: :parent_id, dependent: :destroy
|
||||
|
||||
accepts_nested_attributes_for :champs, allow_destroy: true
|
||||
|
@ -22,12 +20,4 @@ class Champs::RepetitionChamp < Champ
|
|||
def search_terms
|
||||
# The user cannot enter any information here so it doesn’t make much sense to search
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def setup_dossier
|
||||
champs.each do |champ|
|
||||
champ.dossier = dossier
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue