procedure: fix query for finding champs without stable_id
It would break on ActiveRecord 6.1.
This commit is contained in:
parent
7c44662f23
commit
9537342c06
1 changed files with 6 additions and 3 deletions
|
@ -541,9 +541,12 @@ class Procedure < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def populate_champ_stable_ids
|
def populate_champ_stable_ids
|
||||||
TypeDeChamp.where(procedure: self, stable_id: nil).find_each do |type_de_champ|
|
TypeDeChamp
|
||||||
type_de_champ.update_column(:stable_id, type_de_champ.id)
|
.joins(:revisions)
|
||||||
end
|
.where(procedure_revisions: { procedure_id: id }, stable_id: nil)
|
||||||
|
.find_each do |type_de_champ|
|
||||||
|
type_de_champ.update_column(:stable_id, type_de_champ.id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def missing_steps
|
def missing_steps
|
||||||
|
|
Loading…
Add table
Reference in a new issue