Skip to content

Commit

Permalink
Merge pull request #821 from open-data-rescue/fix-image-file-name-issue
Browse files Browse the repository at this point in the history
Fix image file name interpolation for ECCC
  • Loading branch information
balen authored May 11, 2024
2 parents 292ebd6 + 6b9dd79 commit 49e4347
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/models/file_attachment.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
module FileAttachment

module ClassMethods
Paperclip.interpolates :avatar_file_name do |attachment, style|
attachment.instance.avatar_file_name
end

Paperclip.interpolates :image_file_name do |attachment, style|
attachment.instance.image_file_name
end

# Page and User Avatar use the same pattern
def page_url(args)
if args[1].present?
Expand Down Expand Up @@ -35,6 +43,8 @@ def avatar_url(args)
args
end

# problem for /uploads/:class/:style/:image_file_name
# image_file_name is not found
def attachment_url_str
if isDraw?
"/system/:attachment/:style/:hash.:extension"
Expand Down

0 comments on commit 49e4347

Please sign in to comment.