Open coneybeare opened 4 years ago
hey, stumbled upon this issue, are there any plans or estimations on fixing it? or may be some workaround exists? I suppose recently spree migrated to active storage, but spree_digital uses papperclip's methods? If so, do you have plans to introduce spree_digital with active storage support?
# app/controllers/spree/digitals_controller_decorator.rb
module Spree
module DigitalsControllerDecorator
def show
if attachment.present?
if digital_link.authorize!
if Rails.application.config.active_storage.service == :amazon
redirect_to main_app.rails_blob_path(attachment, disposition: "attachment") and return
else
send_file(
ActiveStorage::Blob.service.path_for(attachment.key),
filename: attachment.record.attachment_file_name,
type: attachment.record.attachment_content_type,
status: :ok
) and return
end
end
else
Rails.logger.error 'Missing Digital Item: attachment'
end
render :unauthorized
end
end
end
::Spree::DigitalsController.prepend Spree::DigitalsControllerDecorator unless ::Spree::DigitalsController.included_modules.include? Spree::DigitalsControllerDecorator
Problematic line: https://github.com/spree-contrib/spree_digital/blob/31f31d6ad592e361816bb1b9dddbed215996da58/app/controllers/spree/digitals_controller.rb#L7