Commit 10e7ec44124f7cc5609c8193864574b12165c7d0
1 parent
21a97a65
Exists in
master
and in
20 other branches
rails4: fix size to nil instead empty string (do not use to_s)
Showing
1 changed file
with
3 additions
and
6 deletions
Show diff stats
lib/delayed_attachment_fu.rb
| ... | ... | @@ -39,14 +39,11 @@ module DelayedAttachmentFu |
| 39 | 39 | end |
| 40 | 40 | |
| 41 | 41 | def public_filename(size=nil) |
| 42 | - force = (size == :uploaded) | |
| 43 | - if force | |
| 44 | - size = nil | |
| 45 | - end | |
| 42 | + force, size = true, nil if size == :uploaded | |
| 46 | 43 | if !self.thumbnailable? || self.thumbnails_processed || force |
| 47 | - super(size.to_s) | |
| 44 | + super size | |
| 48 | 45 | else |
| 49 | - size ||= 'thumb' | |
| 46 | + size ||= :thumb | |
| 50 | 47 | '/images/icons-app/image-loading-%s.png' % size |
| 51 | 48 | end |
| 52 | 49 | end | ... | ... |