[Git][noosfero/noosfero][master] 2 commits: image: fix image filename slug treatment

Rodrigo Souto gitlab at mg.gitlab.com
Mon Jan 29 12:53:06 BRST 2018


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
a4b93b0b by Rodrigo Souto at 2018-01-22T13:08:09-03:00
image: fix image filename slug treatment

- - - - -
c3493613 by Rodrigo Souto at 2018-01-29T14:52:58+00:00
Merge branch 'image-filename' into 'master'

image: fix image filename slug treatment

See merge request noosfero/noosfero!1380
- - - - -


1 changed file:

- app/models/concerns/delayed_attachment_fu.rb


Changes:

=====================================
app/models/concerns/delayed_attachment_fu.rb
=====================================
--- a/app/models/concerns/delayed_attachment_fu.rb
+++ b/app/models/concerns/delayed_attachment_fu.rb
@@ -10,7 +10,7 @@ module DelayedAttachmentFu
         (origfname, fname, ext) = file.split_filename
         # ensure there is a fname
         fname = fname || file.filename
-        fname, thumb_suffix = fname.split(/(_big|_icon|_minor|_portrait|_thumb)$/) if file.kind_of?(Image) || file.is_image?
+        fname, thumb_suffix = fname.split(/(_big|_icon|_minor|_portrait|_thumb)$/) if file.try(:thumbnail?)
         thumb_suffix ||= ''
         # makes filename secure for FS manipulation and URLs
         file.filename = fname.to_slug + thumb_suffix + ext.to_s.to_slug



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/8123330e8f4335287d1c5d5c6f7210f9d5529070...c3493613781df00230ed99d928fcbabc4ccff29f

---
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/8123330e8f4335287d1c5d5c6f7210f9d5529070...c3493613781df00230ed99d928fcbabc4ccff29f
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180129/2762df01/attachment.html>


More information about the Noosfero-dev mailing list