Sha256: b211ac1950c4dd91708f49cedf0c5724d62784995531dba06ab0cd6ce8d01e2e

Contents?: true

Size: 505 Bytes

Versions: 26

Compression:

Stored size: 505 Bytes

Contents

module Para
  class ActiveStorageDownloader
    if defined?(ActiveStorage)
      include ActiveStorage::Downloading
    end

    attr_reader :attachment
    
    delegate :blob, to: :attachment

    def initialize(attachment)
      @attachment = attachment
    end

    if defined?(ActiveStorage)
      public :download_blob_to_tempfile
    else
      define_method(:download_blob_to_tempfile) do
        raise NoMethodError, "ActiveStorage is not included in your application"
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
para-0.9.4 lib/para/active_storage_downloader.rb
para-0.9.3.3 lib/para/active_storage_downloader.rb
para-0.9.3.2 lib/para/active_storage_downloader.rb
para-0.9.3.1 lib/para/active_storage_downloader.rb
para-0.9.2 lib/para/active_storage_downloader.rb
para-0.9.0 lib/para/active_storage_downloader.rb
para-0.8.15 lib/para/active_storage_downloader.rb
para-0.8.14 lib/para/active_storage_downloader.rb
para-0.8.13 lib/para/active_storage_downloader.rb
para-0.8.12 lib/para/active_storage_downloader.rb
para-0.8.11 lib/para/active_storage_downloader.rb
para-0.8.10 lib/para/active_storage_downloader.rb
para-0.8.9 lib/para/active_storage_downloader.rb
para-0.8.8 lib/para/active_storage_downloader.rb
para-0.8.7 lib/para/active_storage_downloader.rb
para-0.8.5 lib/para/active_storage_downloader.rb
para-0.8.3.3 lib/para/active_storage_downloader.rb
para-0.8.3.2 lib/para/active_storage_downloader.rb
para-0.8.3.1 lib/para/active_storage_downloader.rb
para-0.8.3 lib/para/active_storage_downloader.rb