Skip to content

Instantly share code, notes, and snippets.

@fjfish
Created July 18, 2010 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fjfish/480466 to your computer and use it in GitHub Desktop.
Save fjfish/480466 to your computer and use it in GitHub Desktop.
module Paperclip
class Attachment
def url style = default_style, include_updated_timestamp = true
url = original_filename.nil? ? interpolate(@default_url, style) : interpolate(@url, style)
include_updated_timestamp && updated_at ? [url, updated_at].compact.join(url.include?("?") ? "&" : "?") : url
url.gsub(/s3\./,"s3-eu-west-1.")
end
end
end
@fjfish
Copy link
Author

fjfish commented Jul 18, 2010

Actually, should look like this

(include_updated_timestamp && updated_at ? [url, updated_at].compact.join(url.include?("?") ? "&" : "?") : url).gsub(/s3./,"s3-eu-west-1.")

@fjfish
Copy link
Author

fjfish commented Jul 18, 2010

But this is a dirty hack and I don't like it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment