Module: DelayedPaperclip::UrlGenerator
- Defined in:
- lib/delayed_paperclip/url_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #delayed_default_url? ⇒ Boolean
- #most_appropriate_url_with_processed ⇒ Object
- #timestamp_possible_with_processed? ⇒ Boolean
Class Method Details
.included(base) ⇒ Object
5 6 7 8 |
# File 'lib/delayed_paperclip/url_generator.rb', line 5 def self.included(base) base.alias_method_chain :most_appropriate_url, :processed base.alias_method_chain :timestamp_possible?, :processed end |
Instance Method Details
#delayed_default_url? ⇒ Boolean
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/delayed_paperclip/url_generator.rb', line 30 def delayed_default_url? return false if .job_is_processing return false if .dirty? return false if not ..try(:[], :url_with_processing) return false if not (.instance.respond_to?(:"#{@attachment.name}_processing?") && .processing?) true # OLD CRAZY CONDITIONAL # TODO: Delete # !( # @attachment.job_is_processing || # @attachment.dirty? || # [email protected]_options.try(:[], :url_with_processing) || # !(@attachment.instance.respond_to?(:"#{@attachment.name}_processing?") && @attachment.processing?) # ) end |
#most_appropriate_url_with_processed ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/delayed_paperclip/url_generator.rb', line 10 def most_appropriate_url_with_processed if .original_filename.nil? || delayed_default_url? if ..nil? || .processing_image_url.nil? || !.processing? default_url else .processing_image_url end else [:url] end end |
#timestamp_possible_with_processed? ⇒ Boolean
22 23 24 25 26 27 28 |
# File 'lib/delayed_paperclip/url_generator.rb', line 22 def if delayed_default_url? false else end end |