Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed some test code

  • Loading branch information...
commit 846f715ae9fbc0ed126c65a8ea7bfe75b611557d 1 parent 8dcc0f4
dewski authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 lib/delayed/paperclip.rb
View
27 lib/delayed/paperclip.rb
@@ -75,4 +75,31 @@ def column_exists?(column)
end
end
end
+end
+
+module Paperclip
+ class Attachment
+ attr_accessor :job_is_processing
+
+ def url_with_processed style = default_style, include_updated_timestamp = true
+ return url_without_processed style, include_updated_timestamp unless @instance.respond_to?(:column_exists?)
+ return url_without_processed style, include_updated_timestamp if job_is_processing
+
+ if !@instance.column_exists?(:"#{@name}_processing")
+ url_without_processed style, include_updated_timestamp
+ else
+ if !@instance.send(:"#{@name}_processing?")
+ url_without_processed style, include_updated_timestamp
+ else
+ if @instance.send(:"#{@name}_changed?")
+ url_without_processed style, include_updated_timestamp
+ else
+ interpolate(@default_url, style)
+ end
+ end
+ end
+ end
+
+ alias_method_chain :url, :processed
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.