Skip to content

Commit

Permalink
Fix image file name interpolation for ECCC
Browse files Browse the repository at this point in the history
  • Loading branch information
balen committed May 11, 2024
1 parent 292ebd6 commit 6b9dd79
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 6b9dd79

Please sign in to comment.