refactor(dossier): predicates methods must return boolean

This commit is contained in:
Colin Darie 2024-12-10 15:52:17 +01:00
parent a54f022353
commit f6366a9cd3
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4

View file

@ -38,15 +38,15 @@ module DossierCloneConcern
end
def forked_with_changes?
if forked_diff.present?
forked_diff.values.any?(&:present?) || forked_groupe_instructeur_changed?
end
return false if forked_diff.blank?
forked_diff.values.any?(&:present?) || forked_groupe_instructeur_changed?
end
def champ_forked_with_changes?(champ)
if forked_diff.present?
forked_diff.values.any? { |champs| champs.any? { _1.public_id == champ.public_id } }
end
return false if forked_diff.blank?
forked_diff.values.any? { |champs| champs.any? { _1.public_id == champ.public_id } }
end
def make_diff(editing_fork)