Skip to content

Commit

Permalink
refactor(suffix): be consistent with index suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSim committed May 1, 2024
1 parent 65e5a32 commit b5ff39e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions app/models/export_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,8 @@ def attachment_path(dossier, attachment, index, row_index)
end

def suffix(attachment, index, row_index)
suffix = ""
if index >= 1 && !row_index.nil?
suffix += "-#{index + 1}"
suffix += "-#{row_index + 1}" if row_index
end
suffix = "-#{index + 1}"
suffix += "-#{row_index + 1}" if row_index.present?

suffix + attachment.filename.extension_with_delimiter
end
Expand Down

0 comments on commit b5ff39e

Please sign in to comment.