AWS::S3::S3Object.url_for - How to do this with the new AWS SDK Gem?

前端 未结 5 1219
南笙
南笙 2020-12-14 16:04

I\'ve been using this forever with paperclip and aws-s3:

  def authenticated_url(style = nil, expires_in = 90.minutes)
      AWS::S3::S3Object.url_for(attach         


        
5条回答
  •  太阳男子
    2020-12-14 17:04

    I recently made the switch from aws-s3 to aws-sdk as well. I replaced all my url_for with the following:

     def authenticated_url(style = nil, expires_in = 90.minutes)
       self.attachment.expiring_url(expires_in, (style || attachment.default_style))
     end
    

    You can see the discussion in the paperclip issues thread here: https://github.com/thoughtbot/paperclip/issues/732

提交回复
热议问题