Module: RedmineS3::AttachmentsControllerPatch::InstanceMethods

Defined in:
lib/redmine_s3/attachments_controller_patch.rb

Instance Method Summary collapse

Instance Method Details

#redirect_to_s3Object



19
20
21
22
23
24
# File 'lib/redmine_s3/attachments_controller_patch.rb', line 19

def redirect_to_s3
  if @attachment.container.is_a?(Version) || @attachment.container.is_a?(Project)
    @attachment.increment_download
  end
  redirect_to("#{RedmineS3::Connection.uri}/#{@attachment.path_to_file}")
end