Browse files

Merge pull request #11 from endoscient/master

Don't append timestamp to default url while processing
  • Loading branch information...
2 parents c831f61 + c6878cc commit 68fb6dad92de6f9b7fc3c439f1d190e2f7df0d43 @jrgifford jrgifford committed Dec 12, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/delayed_paperclip/url_generator.rb
View
9 lib/delayed_paperclip/url_generator.rb
@@ -4,6 +4,7 @@ module UrlGenerator
def self.included(base)
base.send :include, InstanceMethods
base.alias_method_chain :most_appropriate_url, :processed
+ base.alias_method_chain :timestamp_possible?, :processed
end
def most_appropriate_url_with_processed
@@ -17,6 +18,14 @@ def most_appropriate_url_with_processed
@attachment_options[:url]
end
end
+
+ def timestamp_possible_with_processed?
+ if delayed_default_url?
+ false
+ else
+ timestamp_possible_without_processed?
+ end
+ end
def delayed_default_url?
!(@attachment.job_is_processing || @attachment.dirty? || !@attachment.delayed_options.try(:[], :url_with_processing) || !(@attachment.instance.respond_to?(:"#{@attachment.name}_processing?") && @attachment.processing?))

0 comments on commit 68fb6da

Please sign in to comment.