Skip to content

Instantly share code, notes, and snippets.

@TiuTalk
Last active September 11, 2015 14:39
Show Gist options
  • Save TiuTalk/860b6eee7e7f1452b3cd to your computer and use it in GitHub Desktop.
Save TiuTalk/860b6eee7e7f1452b3cd to your computer and use it in GitHub Desktop.
def download_url
if s3_file?
path = URI.parse(url).path[1..-1]
fog_storage.directories.new(key: s3_bucket).files.new(key: path).url(15.minutes.from_now)
else
url
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment