From 151b2d3268fb688ecaf1d11ee885fb9d5990bd46 Mon Sep 17 00:00:00 2001 From: Caitlin Date: Wed, 11 Sep 2024 15:48:54 -0400 Subject: [PATCH] pull non draft states into a variable --- app/controllers/export_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/export_controller.rb b/app/controllers/export_controller.rb index e323bed65..10553a6a8 100644 --- a/app/controllers/export_controller.rb +++ b/app/controllers/export_controller.rb @@ -9,7 +9,9 @@ def index def non_draft_records? issue_states = current_project.issues.pluck(:state).uniq - (issue_states & ['published', 'ready_for_review']).any? + non_draft_states = ['published', 'ready_for_review'] + + (issue_states & non_draft_states).any? end # In case something goes wrong with the export, fail graciously instead of