NameError (uninitialized constant ActiveStorage::Downloading)

Viewed 639

I am running Rails 6.0.3.2 and ruby 2.6.6

I am trying to use the ActiveStorage::Downloading class but can't figure out how to get it to load! I am getting the error

irb(main):001:0>   include ActiveStorage::Downloading
Traceback (most recent call last):
        1: from (irb):1
NameError (uninitialized constant ActiveStorage::Downloading)

I'm pretty sure this is me, but I can't figure it out. I am using ActiveStorage already in the project, but want to use the download_blob_to_tempfile method.

1 Answers

First, load the library by using require and include to use the methods of that module.

require 'active_storage/downloading'
include ActiveStorage::Downloading
Related