Created
July 18, 2010 15:10
-
-
Save fjfish/480466 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
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
Actually, should look like this
(include_updated_timestamp && updated_at ? [url, updated_at].compact.join(url.include?("?") ? "&" : "?") : url).gsub(/s3./,"s3-eu-west-1.")