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,14 +39,11 @@ module DelayedAttachmentFu | ||
39 | end | 39 | end |
40 | 40 | ||
41 | def public_filename(size=nil) | 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 | if !self.thumbnailable? || self.thumbnails_processed || force | 43 | if !self.thumbnailable? || self.thumbnails_processed || force |
47 | - super(size.to_s) | 44 | + super size |
48 | else | 45 | else |
49 | - size ||= 'thumb' | 46 | + size ||= :thumb |
50 | '/images/icons-app/image-loading-%s.png' % size | 47 | '/images/icons-app/image-loading-%s.png' % size |
51 | end | 48 | end |
52 | end | 49 | end |