Skip to content

Commit 10cfcff

Browse files
committed
Refactor creation of header to get rid of complexity
1 parent 6c5f0db commit 10cfcff

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

app/controllers/stories_controller.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,7 @@ def export
103103

104104
def generate_csv(stories, with_comments: false, export_all: false)
105105
CSV.generate(headers: true) do |csv|
106-
headers = if with_comments
107-
CSV_HEADERS + ["comment"]
108-
else
109-
CSV_HEADERS
110-
end
106+
headers = with_comments ? CSV_HEADERS + ["comment"] : CSV_HEADERS
111107

112108
csv << headers
113109

0 commit comments

Comments
 (0)