Class: Fakerclip::Reads::UrlGenerator

Inherits:
Paperclip::UrlGenerator
  • Object
show all
Defined in:
lib/fakerclip/reads.rb

Instance Method Summary collapse

Instance Method Details

#for(style_name, options) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/fakerclip/reads.rb', line 14

def for(style_name, options)
  uri = URI.parse(super)

  case uri.to_s
  when SUBDOMAIN_BUCKET_REGEX
    "/fake_s3_#{Rails.env}/#{$1}#{uri.request_uri}"
  when PATH_BUCKET_REGEX
    "/fake_s3_#{Rails.env}#{uri.request_uri}"
  else
    uri.to_s
  end
end