Class: DelayedPaperclip::UrlGenerator
- Inherits:
-
Paperclip::UrlGenerator
- Object
- Paperclip::UrlGenerator
- DelayedPaperclip::UrlGenerator
- Defined in:
- lib/delayed_paperclip/url_generator.rb
Instance Method Summary collapse
- #delayed_default_url?(style = nil) ⇒ Boolean
- #for(style_name, options) ⇒ Object
-
#most_appropriate_url(style = nil) ⇒ Object
This method is a mess.
- #timestamp_possible? ⇒ Boolean
Instance Method Details
#delayed_default_url?(style = nil) ⇒ Boolean
42 43 44 45 46 47 48 |
# File 'lib/delayed_paperclip/url_generator.rb', line 42 def delayed_default_url?(style = nil) return false if @attachment.job_is_processing return false if @attachment.dirty? return false if not @attachment..try(:[], :url_with_processing) return false if not processing?(style) true end |
#for(style_name, options) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/delayed_paperclip/url_generator.rb', line 6 def for(style_name, ) most_appropriate_url = @attachment.processing_style?(style_name) ? most_appropriate_url(style_name) : most_appropriate_url() ( escape_url_as_needed( @attachment_options[:interpolator].interpolate(most_appropriate_url, @attachment, style_name), ), ) end |
#most_appropriate_url(style = nil) ⇒ Object
This method is a mess
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/delayed_paperclip/url_generator.rb', line 18 def most_appropriate_url(style = nil) if @attachment.processing_style?(style) if @attachment.original_filename.nil? || delayed_default_url?(style) if @attachment..nil? || @attachment.processing_image_url.nil? || !@attachment.processing? default_url else @attachment.processing_image_url end else @attachment_options[:url] end else super() end end |
#timestamp_possible? ⇒ Boolean
38 39 40 |
# File 'lib/delayed_paperclip/url_generator.rb', line 38 def delayed_default_url? ? false : super end |