[Git][noosfero/noosfero][stable-1.10] Merge branch 'image-filename' into 'master'

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


Rodrigo Souto pushed to branch stable-1.10 at Noosfero / noosfero


Commits:
4c0d9730 by Rodrigo Souto at 2018-01-29T14:53:11+00:00
Merge branch 'image-filename' into 'master'

image: fix image filename slug treatment

See merge request noosfero/noosfero!1380

(cherry picked from commit c3493613781df00230ed99d928fcbabc4ccff29f)

a4b93b0b image: fix image filename slug treatment
- - - - -


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/commit/4c0d973024a410333716128e9c6e50c5e1b262aa

---
View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/4c0d973024a410333716128e9c6e50c5e1b262aa
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/be4853ad/attachment-0001.html>


More information about the Noosfero-dev mailing list