Permalink
Browse files

removed some test code

  • Loading branch information...
1 parent 8dcc0f4 commit 846f715ae9fbc0ed126c65a8ea7bfe75b611557d dewski committed Apr 11, 2010
Showing with 27 additions and 0 deletions.
  1. +27 −0 lib/delayed/paperclip.rb
View
@@ -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

0 comments on commit 846f715

Please sign in to comment.