From 46506ac12a3cc68dc9222e3dee23ed3d82339d0a Mon Sep 17 00:00:00 2001 From: Lubos Hricak Date: Tue, 1 Aug 2023 14:55:21 -0300 Subject: [PATCH] Move `after_action` to the concern This fixes failing specs on production in which `after_action` callback seems to be executed after tables are truncated. --- app/controllers/admin/press_summaries_controller.rb | 1 - app/controllers/assessor/press_summaries_controller.rb | 1 - app/controllers/concerns/press_summary_mixin.rb | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/admin/press_summaries_controller.rb b/app/controllers/admin/press_summaries_controller.rb index 014c03453..4c2897141 100644 --- a/app/controllers/admin/press_summaries_controller.rb +++ b/app/controllers/admin/press_summaries_controller.rb @@ -1,4 +1,3 @@ class Admin::PressSummariesController < Admin::BaseController - after_action :log_event, only: [:create, :update, :submit, :signoff] include PressSummaryMixin end diff --git a/app/controllers/assessor/press_summaries_controller.rb b/app/controllers/assessor/press_summaries_controller.rb index b7cb8089a..56a3f6880 100644 --- a/app/controllers/assessor/press_summaries_controller.rb +++ b/app/controllers/assessor/press_summaries_controller.rb @@ -1,4 +1,3 @@ class Assessor::PressSummariesController < Assessor::BaseController - after_action :log_event, only: [:create, :update, :submit, :signoff] include PressSummaryMixin end diff --git a/app/controllers/concerns/press_summary_mixin.rb b/app/controllers/concerns/press_summary_mixin.rb index 291f9532b..0f6ca9e83 100644 --- a/app/controllers/concerns/press_summary_mixin.rb +++ b/app/controllers/concerns/press_summary_mixin.rb @@ -4,6 +4,7 @@ module PressSummaryMixin def self.included(base) base.before_action :load_form_answer base.before_action :load_press_summary, except: :create + base.after_action :log_event, only: [:create, :update, :submit, :signoff] end def create