From 98a8b9e0c24d24c94e2c9c39a704c1b07c5c4d6b Mon Sep 17 00:00:00 2001 From: Tom Meier Date: Sun, 4 Mar 2012 21:01:23 +1100 Subject: [PATCH 1/4] [Fix] most_appropiate_url changed to be part of Paperclip::UrlGenerator, tested across rails versions and added Rails 3.2 to test suite. Paperclip version bumped to 2.7. - Main issue - `attachment`_updated_at was not being updated, new Paperclip (> 2.4.5) assigns the updated_at of the `attachment`, when S3 took too long, or the queue takes longer than a second to pick the image up, the `attachment`_updated_at and instance.updated_at get out of sync, and the url generated (with :updated_at in the hash_data - default), will not find the newly created images. --- Appraisals | 5 + Gemfile | 6 +- gemfiles/rails2.gemfile | 4 +- gemfiles/rails2.gemfile.lock | 10 +- gemfiles/rails3.gemfile | 4 +- gemfiles/rails3.gemfile.lock | 10 +- gemfiles/rails3_1.gemfile | 4 +- gemfiles/rails3_1.gemfile.lock | 10 +- gemfiles/rails3_2.gemfile | 15 +++ gemfiles/rails3_2.gemfile.lock | 134 +++++++++++++++++++++++++ lib/delayed_paperclip.rb | 1 + lib/delayed_paperclip/attachment.rb | 17 +--- lib/delayed_paperclip/url_generator.rb | 13 +++ 13 files changed, 197 insertions(+), 36 deletions(-) create mode 100644 gemfiles/rails3_2.gemfile create mode 100644 gemfiles/rails3_2.gemfile.lock create mode 100644 lib/delayed_paperclip/url_generator.rb diff --git a/Appraisals b/Appraisals index bb94087..8c02edb 100644 --- a/Appraisals +++ b/Appraisals @@ -9,3 +9,8 @@ end appraise "rails3_1" do gem "rails", "~> 3.1.0" end + +appraise "rails3_2" do + gem "rails", "~> 3.2.0" + gem "delayed_job_active_record" +end diff --git a/Gemfile b/Gemfile index 6d2ad7c..46064d7 100644 --- a/Gemfile +++ b/Gemfile @@ -2,11 +2,13 @@ source "http://rubygems.org" gemspec -gem "paperclip", '2.4.5' +gem "paperclip", '~> 2.7' gem "appraisal" gem "mocha" gem "sqlite3" +gem "json", :platforms => :ruby_18 + gem "delayed_job", :require => false + gem "resque", :require => false -gem "json", :platforms => :ruby_18 \ No newline at end of file diff --git a/gemfiles/rails2.gemfile b/gemfiles/rails2.gemfile index b65cd4d..4b8dcbc 100644 --- a/gemfiles/rails2.gemfile +++ b/gemfiles/rails2.gemfile @@ -2,13 +2,13 @@ source "http://rubygems.org" -gem "paperclip", "2.4.5" +gem "paperclip", "~> 2.7" gem "appraisal" gem "mocha" gem "sqlite3" +gem "json", :platforms=>:ruby_18 gem "delayed_job", :require=>false gem "resque", :require=>false -gem "json", :platforms=>:ruby_18 gem "rails", "~> 2.3.14" gemspec :path=>"../" \ No newline at end of file diff --git a/gemfiles/rails2.gemfile.lock b/gemfiles/rails2.gemfile.lock index d594f9a..8b89851 100644 --- a/gemfiles/rails2.gemfile.lock +++ b/gemfiles/rails2.gemfile.lock @@ -1,7 +1,7 @@ PATH - remote: /Users/bertg/Development/delayed_paperclip + remote: /Users/tom/Development/Projects/delayed_paperclip specs: - delayed_paperclip (2.4.5.0) + delayed_paperclip (2.4.5.1) paperclip (>= 2.4.5) GEM @@ -20,7 +20,7 @@ GEM appraisal (0.3.8) bundler rake - cocaine (0.2.0) + cocaine (0.2.1) daemons (1.0.10) delayed_job (2.0.7) activesupport (~> 2.0) @@ -31,7 +31,7 @@ GEM mocha (0.10.0) metaclass (~> 0.0.1) multi_json (1.0.3) - paperclip (2.4.5) + paperclip (2.7.0) activerecord (>= 2.3.0) activesupport (>= 2.3.2) cocaine (>= 0.0.2) @@ -70,7 +70,7 @@ DEPENDENCIES delayed_paperclip! json mocha - paperclip (= 2.4.5) + paperclip (~> 2.7) rails (~> 2.3.14) resque sqlite3 diff --git a/gemfiles/rails3.gemfile b/gemfiles/rails3.gemfile index c084ae3..5ab762c 100644 --- a/gemfiles/rails3.gemfile +++ b/gemfiles/rails3.gemfile @@ -2,13 +2,13 @@ source "http://rubygems.org" -gem "paperclip", "2.4.5" +gem "paperclip", "~> 2.7" gem "appraisal" gem "mocha" gem "sqlite3" +gem "json", :platforms=>:ruby_18 gem "delayed_job", :require=>false gem "resque", :require=>false -gem "json", :platforms=>:ruby_18 gem "rails", "~> 3.0.10" gemspec :path=>"../" \ No newline at end of file diff --git a/gemfiles/rails3.gemfile.lock b/gemfiles/rails3.gemfile.lock index 793f2b1..d0267c2 100644 --- a/gemfiles/rails3.gemfile.lock +++ b/gemfiles/rails3.gemfile.lock @@ -1,7 +1,7 @@ PATH - remote: /Users/bertg/Development/delayed_paperclip + remote: /Users/tom/Development/Projects/delayed_paperclip specs: - delayed_paperclip (2.4.5.0) + delayed_paperclip (2.4.5.1) paperclip (>= 2.4.5) GEM @@ -39,7 +39,7 @@ GEM rake arel (2.0.10) builder (2.1.2) - cocaine (0.2.0) + cocaine (0.2.1) daemons (1.1.4) delayed_job (2.1.4) activesupport (~> 3.0) @@ -58,7 +58,7 @@ GEM mocha (0.10.0) metaclass (~> 0.0.1) multi_json (1.0.3) - paperclip (2.4.5) + paperclip (2.7.0) activerecord (>= 2.3.0) activesupport (>= 2.3.2) cocaine (>= 0.0.2) @@ -116,7 +116,7 @@ DEPENDENCIES delayed_paperclip! json mocha - paperclip (= 2.4.5) + paperclip (~> 2.7) rails (~> 3.0.10) resque sqlite3 diff --git a/gemfiles/rails3_1.gemfile b/gemfiles/rails3_1.gemfile index a57068a..e25f818 100644 --- a/gemfiles/rails3_1.gemfile +++ b/gemfiles/rails3_1.gemfile @@ -2,13 +2,13 @@ source "http://rubygems.org" -gem "paperclip", "2.4.5" +gem "paperclip", "~> 2.7" gem "appraisal" gem "mocha" gem "sqlite3" +gem "json", :platforms=>:ruby_18 gem "delayed_job", :require=>false gem "resque", :require=>false -gem "json", :platforms=>:ruby_18 gem "rails", "~> 3.1.0" gemspec :path=>"../" \ No newline at end of file diff --git a/gemfiles/rails3_1.gemfile.lock b/gemfiles/rails3_1.gemfile.lock index 3d11b89..37fb2ea 100644 --- a/gemfiles/rails3_1.gemfile.lock +++ b/gemfiles/rails3_1.gemfile.lock @@ -1,7 +1,7 @@ PATH - remote: /Users/bertg/Development/delayed_paperclip + remote: /Users/tom/Development/Projects/delayed_paperclip specs: - delayed_paperclip (2.4.5.0) + delayed_paperclip (2.4.5.1) paperclip (>= 2.4.5) GEM @@ -40,7 +40,7 @@ GEM rake arel (2.2.1) builder (3.0.0) - cocaine (0.2.0) + cocaine (0.2.1) daemons (1.1.4) delayed_job (2.1.4) activesupport (~> 3.0) @@ -58,7 +58,7 @@ GEM mocha (0.10.0) metaclass (~> 0.0.1) multi_json (1.0.3) - paperclip (2.4.5) + paperclip (2.7.0) activerecord (>= 2.3.0) activesupport (>= 2.3.2) cocaine (>= 0.0.2) @@ -128,7 +128,7 @@ DEPENDENCIES delayed_paperclip! json mocha - paperclip (= 2.4.5) + paperclip (~> 2.7) rails (~> 3.1.0) resque sqlite3 diff --git a/gemfiles/rails3_2.gemfile b/gemfiles/rails3_2.gemfile new file mode 100644 index 0000000..7a0634a --- /dev/null +++ b/gemfiles/rails3_2.gemfile @@ -0,0 +1,15 @@ +# This file was generated by Appraisal + +source "http://rubygems.org" + +gem "paperclip", "~> 2.7" +gem "appraisal" +gem "mocha" +gem "sqlite3" +gem "json", :platforms=>:ruby_18 +gem "delayed_job", :require=>false +gem "resque", :require=>false +gem "rails", "~> 3.2.0" +gem "delayed_job_active_record" + +gemspec :path=>"../" \ No newline at end of file diff --git a/gemfiles/rails3_2.gemfile.lock b/gemfiles/rails3_2.gemfile.lock new file mode 100644 index 0000000..305f03b --- /dev/null +++ b/gemfiles/rails3_2.gemfile.lock @@ -0,0 +1,134 @@ +PATH + remote: /Users/tom/Development/Projects/delayed_paperclip + specs: + delayed_paperclip (2.4.5.1) + paperclip (>= 2.4.5) + +GEM + remote: http://rubygems.org/ + specs: + actionmailer (3.2.2) + actionpack (= 3.2.2) + mail (~> 2.4.0) + actionpack (3.2.2) + activemodel (= 3.2.2) + activesupport (= 3.2.2) + builder (~> 3.0.0) + erubis (~> 2.7.0) + journey (~> 1.0.1) + rack (~> 1.4.0) + rack-cache (~> 1.1) + rack-test (~> 0.6.1) + sprockets (~> 2.1.2) + activemodel (3.2.2) + activesupport (= 3.2.2) + builder (~> 3.0.0) + activerecord (3.2.2) + activemodel (= 3.2.2) + activesupport (= 3.2.2) + arel (~> 3.0.2) + tzinfo (~> 0.3.29) + activeresource (3.2.2) + activemodel (= 3.2.2) + activesupport (= 3.2.2) + activesupport (3.2.2) + i18n (~> 0.6) + multi_json (~> 1.0) + appraisal (0.4.1) + bundler + rake + arel (3.0.2) + builder (3.0.0) + cocaine (0.2.1) + delayed_job (3.0.1) + activesupport (~> 3.0) + delayed_job_active_record (0.3.2) + activerecord (> 2.1.0) + delayed_job (~> 3.0.0) + erubis (2.7.0) + hike (1.2.1) + i18n (0.6.0) + journey (1.0.3) + json (1.6.5) + mail (2.4.1) + i18n (>= 0.4.0) + mime-types (~> 1.16) + treetop (~> 1.4.8) + metaclass (0.0.1) + mime-types (1.17.2) + mocha (0.10.5) + metaclass (~> 0.0.1) + multi_json (1.1.0) + paperclip (2.7.0) + activerecord (>= 2.3.0) + activesupport (>= 2.3.2) + cocaine (>= 0.0.2) + mime-types + polyglot (0.3.3) + rack (1.4.1) + rack-cache (1.1) + rack (>= 0.4) + rack-protection (1.2.0) + rack + rack-ssl (1.3.2) + rack + rack-test (0.6.1) + rack (>= 1.0) + rails (3.2.2) + actionmailer (= 3.2.2) + actionpack (= 3.2.2) + activerecord (= 3.2.2) + activeresource (= 3.2.2) + activesupport (= 3.2.2) + bundler (~> 1.0) + railties (= 3.2.2) + railties (3.2.2) + actionpack (= 3.2.2) + activesupport (= 3.2.2) + rack-ssl (~> 1.3.2) + rake (>= 0.8.7) + rdoc (~> 3.4) + thor (~> 0.14.6) + rake (0.9.2.2) + rdoc (3.12) + json (~> 1.4) + redis (2.2.2) + redis-namespace (1.0.3) + redis (< 3.0.0) + resque (1.20.0) + multi_json (~> 1.0) + redis-namespace (~> 1.0.2) + sinatra (>= 0.9.2) + vegas (~> 0.1.2) + sinatra (1.3.2) + rack (~> 1.3, >= 1.3.6) + rack-protection (~> 1.2) + tilt (~> 1.3, >= 1.3.3) + sprockets (2.1.2) + hike (~> 1.2) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + sqlite3 (1.3.5) + thor (0.14.6) + tilt (1.3.3) + treetop (1.4.10) + polyglot + polyglot (>= 0.3.1) + tzinfo (0.3.31) + vegas (0.1.11) + rack (>= 1.0.0) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal + delayed_job + delayed_job_active_record + delayed_paperclip! + json + mocha + paperclip (~> 2.7) + rails (~> 3.2.0) + resque + sqlite3 diff --git a/lib/delayed_paperclip.rb b/lib/delayed_paperclip.rb index c8e0226..1276c6e 100644 --- a/lib/delayed_paperclip.rb +++ b/lib/delayed_paperclip.rb @@ -1,5 +1,6 @@ require 'delayed_paperclip/jobs' require 'delayed_paperclip/attachment' +require 'delayed_paperclip/url_generator' require 'delayed_paperclip/railtie' module DelayedPaperclip diff --git a/lib/delayed_paperclip/attachment.rb b/lib/delayed_paperclip/attachment.rb index 24969e2..9687c8b 100644 --- a/lib/delayed_paperclip/attachment.rb +++ b/lib/delayed_paperclip/attachment.rb @@ -7,7 +7,6 @@ def self.included(base) base.alias_method_chain :post_processing, :delay base.alias_method_chain :post_processing=, :delay base.alias_method_chain :save, :prepare_enqueueing - base.alias_method_chain :most_appropriate_url, :processed base.alias_method_chain :post_process_styles, :processing end @@ -46,12 +45,10 @@ def process_delayed! def post_process_styles_with_processing(*args) post_process_styles_without_processing(*args) - # update_column is available in rails 3.1 instead we can do this to update the attribute without callbacks - - #instance.update_column("#{name}_processing", false) if instance.respond_to?(:"#{name}_processing?") if instance.respond_to?(:"#{name}_processing?") instance.send("#{name}_processing=", false) - instance.class.update_all({ "#{name}_processing" => false }, instance.class.primary_key => instance.id) + + instance.class.update_all({ "#{name}_processing" => false, "#{name}_updated_at" => Time.at(self.updated_at) }, instance.class.primary_key => instance.id) end end @@ -64,14 +61,6 @@ def save_with_prepare_enqueueing end end - def most_appropriate_url_with_processed - if original_filename.nil? || delayed_default_url? - default_url - else - @options.url - end - end - def delayed_default_url? !(job_is_processing || dirty? || !delayed_options.try(:[], :url_with_processing) || !(@instance.respond_to?(:"#{name}_processing?") && processing?)) end @@ -79,3 +68,5 @@ def delayed_default_url? end end end + + diff --git a/lib/delayed_paperclip/url_generator.rb b/lib/delayed_paperclip/url_generator.rb new file mode 100644 index 0000000..3bc2767 --- /dev/null +++ b/lib/delayed_paperclip/url_generator.rb @@ -0,0 +1,13 @@ +module Paperclip + class UrlGenerator + + def most_appropriate_url + if @attachment.original_filename.nil? || @attachment.delayed_default_url? + default_url + else + @attachment_options[:url] + end + end + + end +end \ No newline at end of file From 4e07528f3840d71bf24cecad1871930e496c6fdf Mon Sep 17 00:00:00 2001 From: Tom Meier Date: Mon, 2 Jul 2012 11:06:02 +1000 Subject: [PATCH 2/4] [Upgrade] Allow paperclip 3.x to work, tested with 3.1.2 --- Gemfile | 2 +- delayed_paperclip.gemspec | 2 +- gemfiles/rails2.gemfile | 2 +- gemfiles/rails2.gemfile.lock | 4 ++-- gemfiles/rails3.gemfile | 2 +- gemfiles/rails3.gemfile.lock | 4 ++-- gemfiles/rails3_1.gemfile | 2 +- gemfiles/rails3_1.gemfile.lock | 4 ++-- gemfiles/rails3_2.gemfile | 2 +- gemfiles/rails3_2.gemfile.lock | 4 ++-- lib/delayed_paperclip/attachment.rb | 4 ++++ lib/delayed_paperclip/jobs/resque.rb | 2 +- test/base_delayed_paperclip_test.rb | 10 ++++++++++ 13 files changed, 29 insertions(+), 15 deletions(-) diff --git a/Gemfile b/Gemfile index 46064d7..67f5d86 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source "http://rubygems.org" gemspec -gem "paperclip", '~> 2.7' +gem "paperclip" gem "appraisal" gem "mocha" diff --git a/delayed_paperclip.gemspec b/delayed_paperclip.gemspec index 20e96fc..8168ef2 100644 --- a/delayed_paperclip.gemspec +++ b/delayed_paperclip.gemspec @@ -8,7 +8,7 @@ end.flatten spec = Gem::Specification.new do |s| s.name = %q{delayed_paperclip} - s.version = "2.4.5.1" + s.version = "2.4.5.2" s.authors = ["Jesse Storimer", "Bert Goethals"] s.summary = %q{Process your Paperclip attachments in the background.} diff --git a/gemfiles/rails2.gemfile b/gemfiles/rails2.gemfile index 4b8dcbc..c716573 100644 --- a/gemfiles/rails2.gemfile +++ b/gemfiles/rails2.gemfile @@ -2,7 +2,7 @@ source "http://rubygems.org" -gem "paperclip", "~> 2.7" +gem "paperclip" gem "appraisal" gem "mocha" gem "sqlite3" diff --git a/gemfiles/rails2.gemfile.lock b/gemfiles/rails2.gemfile.lock index 8b89851..8e6b406 100644 --- a/gemfiles/rails2.gemfile.lock +++ b/gemfiles/rails2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: /Users/tom/Development/Projects/delayed_paperclip specs: - delayed_paperclip (2.4.5.1) + delayed_paperclip (2.4.5.2) paperclip (>= 2.4.5) GEM @@ -70,7 +70,7 @@ DEPENDENCIES delayed_paperclip! json mocha - paperclip (~> 2.7) + paperclip rails (~> 2.3.14) resque sqlite3 diff --git a/gemfiles/rails3.gemfile b/gemfiles/rails3.gemfile index 5ab762c..d59f943 100644 --- a/gemfiles/rails3.gemfile +++ b/gemfiles/rails3.gemfile @@ -2,7 +2,7 @@ source "http://rubygems.org" -gem "paperclip", "~> 2.7" +gem "paperclip" gem "appraisal" gem "mocha" gem "sqlite3" diff --git a/gemfiles/rails3.gemfile.lock b/gemfiles/rails3.gemfile.lock index d0267c2..09b3942 100644 --- a/gemfiles/rails3.gemfile.lock +++ b/gemfiles/rails3.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: /Users/tom/Development/Projects/delayed_paperclip specs: - delayed_paperclip (2.4.5.1) + delayed_paperclip (2.4.5.2) paperclip (>= 2.4.5) GEM @@ -116,7 +116,7 @@ DEPENDENCIES delayed_paperclip! json mocha - paperclip (~> 2.7) + paperclip rails (~> 3.0.10) resque sqlite3 diff --git a/gemfiles/rails3_1.gemfile b/gemfiles/rails3_1.gemfile index e25f818..36a3650 100644 --- a/gemfiles/rails3_1.gemfile +++ b/gemfiles/rails3_1.gemfile @@ -2,7 +2,7 @@ source "http://rubygems.org" -gem "paperclip", "~> 2.7" +gem "paperclip" gem "appraisal" gem "mocha" gem "sqlite3" diff --git a/gemfiles/rails3_1.gemfile.lock b/gemfiles/rails3_1.gemfile.lock index 37fb2ea..07d5af4 100644 --- a/gemfiles/rails3_1.gemfile.lock +++ b/gemfiles/rails3_1.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: /Users/tom/Development/Projects/delayed_paperclip specs: - delayed_paperclip (2.4.5.1) + delayed_paperclip (2.4.5.2) paperclip (>= 2.4.5) GEM @@ -128,7 +128,7 @@ DEPENDENCIES delayed_paperclip! json mocha - paperclip (~> 2.7) + paperclip rails (~> 3.1.0) resque sqlite3 diff --git a/gemfiles/rails3_2.gemfile b/gemfiles/rails3_2.gemfile index 7a0634a..a4645c9 100644 --- a/gemfiles/rails3_2.gemfile +++ b/gemfiles/rails3_2.gemfile @@ -2,7 +2,7 @@ source "http://rubygems.org" -gem "paperclip", "~> 2.7" +gem "paperclip" gem "appraisal" gem "mocha" gem "sqlite3" diff --git a/gemfiles/rails3_2.gemfile.lock b/gemfiles/rails3_2.gemfile.lock index 305f03b..c2f13e6 100644 --- a/gemfiles/rails3_2.gemfile.lock +++ b/gemfiles/rails3_2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: /Users/tom/Development/Projects/delayed_paperclip specs: - delayed_paperclip (2.4.5.1) + delayed_paperclip (2.4.5.2) paperclip (>= 2.4.5) GEM @@ -128,7 +128,7 @@ DEPENDENCIES delayed_paperclip! json mocha - paperclip (~> 2.7) + paperclip rails (~> 3.2.0) resque sqlite3 diff --git a/lib/delayed_paperclip/attachment.rb b/lib/delayed_paperclip/attachment.rb index 9687c8b..b1550cd 100644 --- a/lib/delayed_paperclip/attachment.rb +++ b/lib/delayed_paperclip/attachment.rb @@ -38,7 +38,11 @@ def processing? def process_delayed! self.job_is_processing = true + self.post_processing = true + reprocess! + + self.post_processing = false self.job_is_processing = false end diff --git a/lib/delayed_paperclip/jobs/resque.rb b/lib/delayed_paperclip/jobs/resque.rb index 67ac9ef..5152acb 100644 --- a/lib/delayed_paperclip/jobs/resque.rb +++ b/lib/delayed_paperclip/jobs/resque.rb @@ -14,4 +14,4 @@ def self.perform(instance_klass, instance_id, attachment_name) end end end -end \ No newline at end of file +end diff --git a/test/base_delayed_paperclip_test.rb b/test/base_delayed_paperclip_test.rb index 6195262..c7ef2c6 100644 --- a/test/base_delayed_paperclip_test.rb +++ b/test/base_delayed_paperclip_test.rb @@ -70,6 +70,16 @@ def test_processed_true_when_delayed_jobs_completed assert !dummy.image_processing?, "Image should no longer be processing" end + def test_post_processing_value_updated_for_reprocessing + Paperclip::Attachment.any_instance.expects(:post_processing=).with(true) + Paperclip::Attachment.any_instance.expects(:post_processing=).with(false) + + dummy = Dummy.new(:image => File.open("#{RAILS_ROOT}/test/fixtures/12k.png")) + dummy.save! + process_jobs + assert !dummy.image.post_processing + end + def test_unprocessed_image_returns_missing_url dummy = Dummy.new(:image => File.open("#{RAILS_ROOT}/test/fixtures/12k.png")) dummy.save! From c7ce3672efc0f23db76797d5d23968d6e61b80d0 Mon Sep 17 00:00:00 2001 From: Tom Meier Date: Mon, 2 Jul 2012 11:32:40 +1000 Subject: [PATCH 3/4] [Update] Unnecesary to mark post_processing as false, because paperclip does this in reprocess, test updated to ensure outcome --- lib/delayed_paperclip/attachment.rb | 2 +- test/base_delayed_paperclip_test.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/delayed_paperclip/attachment.rb b/lib/delayed_paperclip/attachment.rb index b1550cd..afbb009 100644 --- a/lib/delayed_paperclip/attachment.rb +++ b/lib/delayed_paperclip/attachment.rb @@ -42,7 +42,7 @@ def process_delayed! reprocess! - self.post_processing = false + #self.post_processing = false self.job_is_processing = false end diff --git a/test/base_delayed_paperclip_test.rb b/test/base_delayed_paperclip_test.rb index c7ef2c6..e98be08 100644 --- a/test/base_delayed_paperclip_test.rb +++ b/test/base_delayed_paperclip_test.rb @@ -72,12 +72,11 @@ def test_processed_true_when_delayed_jobs_completed def test_post_processing_value_updated_for_reprocessing Paperclip::Attachment.any_instance.expects(:post_processing=).with(true) - Paperclip::Attachment.any_instance.expects(:post_processing=).with(false) dummy = Dummy.new(:image => File.open("#{RAILS_ROOT}/test/fixtures/12k.png")) dummy.save! process_jobs - assert !dummy.image.post_processing + assert !dummy.image.post_processing, "Image should no longer have post processing marked" end def test_unprocessed_image_returns_missing_url From c23a537c0c5d7488059b07a036ebfa4f5e52d43e Mon Sep 17 00:00:00 2001 From: Tom Meier Date: Mon, 2 Jul 2012 11:33:30 +1000 Subject: [PATCH 4/4] Removed commented line --- lib/delayed_paperclip/attachment.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/delayed_paperclip/attachment.rb b/lib/delayed_paperclip/attachment.rb index afbb009..bf135fa 100644 --- a/lib/delayed_paperclip/attachment.rb +++ b/lib/delayed_paperclip/attachment.rb @@ -42,7 +42,6 @@ def process_delayed! reprocess! - #self.post_processing = false self.job_is_processing = false end