Apply suggestions from code review

Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
This commit is contained in:
Paul Chavard 2021-05-27 18:50:39 +02:00
parent a0d4c9d54c
commit f526e303e8

View file

@ -550,7 +550,7 @@ class Procedure < ApplicationRecord
end
def whitelist!
update_attribute('whitelisted_at', Time.zone.now)
touch(:whitelisted_at)
end
def closed_mail_template_attestation_inconsistency_state
@ -693,20 +693,21 @@ class Procedure < ApplicationRecord
end
def after_publish(canonical_procedure = nil)
update!(published_at: Time.zone.now, canonical_procedure: canonical_procedure, draft_revision: create_new_revision, published_revision: draft_revision)
published_revision.update!(published_at: Time.zone.now)
update!(canonical_procedure: canonical_procedure, draft_revision: create_new_revision, published_revision: draft_revision)
touch(:published_at)
published_revision.touch(:published_at)
end
def after_republish(canonical_procedure = nil)
update!(published_at: Time.zone.now)
touch(:published_at)
end
def after_close
update!(closed_at: Time.zone.now)
touch(:closed_at)
end
def after_unpublish
update!(unpublished_at: Time.zone.now)
touch(:unpublished_at)
end
def update_juridique_required