Skip to content

ActiveStorage does not respond to expiring_url #125

@coneybeare

Description

@coneybeare

Problematic line:

redirect_to attachment.expiring_url(Spree::DigitalConfiguration[:s3_expiration_seconds]) and return

2.7.1 :004 > digital.attachment.expiring_url
  ActiveStorage::Attachment Load (0.9ms)  SELECT `active_storage_attachments`.* FROM `active_storage_attachments` WHERE `active_storage_attachments`.`record_id` = 1021 AND `active_storage_attachments`.`record_type` = 'Spree::Digital' AND `active_storage_attachments`.`name` = 'attachment' LIMIT 1
  ActiveStorage::Blob Load (0.6ms)  SELECT `active_storage_blobs`.* FROM `active_storage_blobs` WHERE `active_storage_blobs`.`id` = 6585 LIMIT 1
Traceback (most recent call last):
        1: from (irb):4
NoMethodError (undefined method `expiring_url' for #<ActiveStorage::Attached::One:0x00001256bd908050>)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions