Skip to content

Commit

Permalink
Refactor creation of header to get rid of complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
torresga committed Nov 6, 2024
1 parent 6c5f0db commit 10cfcff
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/controllers/stories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ def export

def generate_csv(stories, with_comments: false, export_all: false)
CSV.generate(headers: true) do |csv|
headers = if with_comments
CSV_HEADERS + ["comment"]
else
CSV_HEADERS
end
headers = with_comments ? CSV_HEADERS + ["comment"] : CSV_HEADERS

csv << headers

Expand Down

0 comments on commit 10cfcff

Please sign in to comment.