Update procedure path attribute when procedure_path changes
This commit is contained in:
parent
b772256a97
commit
b042efdcba
1 changed files with 3 additions and 2 deletions
|
@ -107,6 +107,7 @@ class Procedure < ApplicationRecord
|
||||||
else
|
else
|
||||||
create_procedure_path!(administrateur: administrateur, path: path)
|
create_procedure_path!(administrateur: administrateur, path: path)
|
||||||
end
|
end
|
||||||
|
update!(path: path)
|
||||||
end
|
end
|
||||||
|
|
||||||
def reset!
|
def reset!
|
||||||
|
@ -385,12 +386,12 @@ class Procedure < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_archive
|
def after_archive
|
||||||
update!(archived_at: Time.now)
|
update!(archived_at: Time.now, path: nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_hide
|
def after_hide
|
||||||
now = Time.now
|
now = Time.now
|
||||||
update!(hidden_at: now)
|
update!(hidden_at: now, path: nil)
|
||||||
procedure_path&.hide!
|
procedure_path&.hide!
|
||||||
dossiers.update_all(hidden_at: now)
|
dossiers.update_all(hidden_at: now)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue