delayed_paperclip 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/delayed_paperclip.gemspec +1 -1
- data/lib/delayed/paperclip.rb +6 -2
- data/test/delayed_paperclip_test.rb +12 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.1
|
data/delayed_paperclip.gemspec
CHANGED
data/lib/delayed/paperclip.rb
CHANGED
@@ -83,10 +83,14 @@ end
|
|
83
83
|
module Paperclip
|
84
84
|
class Attachment
|
85
85
|
def url_with_processed style = default_style, include_updated_timestamp = true
|
86
|
-
if
|
86
|
+
if !@instance.column_exists?(:"#{@name}_processing")
|
87
87
|
url_without_processed style, include_updated_timestamp
|
88
88
|
else
|
89
|
-
|
89
|
+
if !@instance.send(:"#{@name}_processing?")
|
90
|
+
url_without_processed style, include_updated_timestamp
|
91
|
+
else
|
92
|
+
interpolate(@default_url, style)
|
93
|
+
end
|
90
94
|
end
|
91
95
|
end
|
92
96
|
alias_method_chain :url, :processed
|
@@ -103,4 +103,16 @@ class DelayedPaperclipTest < Test::Unit::TestCase
|
|
103
103
|
@dummy.reload
|
104
104
|
assert_match(/\/system\/images\/1\/original\/12k.png/, @dummy.image.url)
|
105
105
|
end
|
106
|
+
|
107
|
+
def test_original_url_when_no_processing_column
|
108
|
+
@dummy = reset_dummy(false)
|
109
|
+
@dummy.save!
|
110
|
+
|
111
|
+
assert_match(/\/system\/images\/1\/original\/12k.png/, @dummy.image.url)
|
112
|
+
|
113
|
+
# Delayed::Job.first.invoke_job
|
114
|
+
#
|
115
|
+
# @dummy.reload
|
116
|
+
# assert_match(/\/system\/images\/1\/original\/12k.png/, @dummy.image.url)
|
117
|
+
end
|
106
118
|
end
|