Skip to content

Commit

Permalink
Fix titles of attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
entantoencuanto committed Nov 26, 2024
1 parent 7d635b6 commit 0fda91c
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ def add_attachments
create_attachments
end

def title_for(attachment)
return { I18n.locale => attachment[:title] } if attachment.is_a?(Hash) && attachment.has_key?(:title)

{ I18n.locale => attachment.original_filename }
end

def attachments_allowed?
@attachments_allowed ||= begin
root_commentable = root_commentable(form.commentable)
Expand Down

0 comments on commit 0fda91c

Please sign in to comment.