Sha256: 1421d3ee33f003276c4dbb498eadd7a795601e063ec03836c6eee5f3bd991dc2

Contents?: true

Size: 483 Bytes

Versions: 3

Compression:

Stored size: 483 Bytes

Contents

module Spotlight
  # Used by RIIIF to find files uploaded by carrierwave
  class CarrierwaveFileResolver < Riiif::AbstractFileSystemResolver
    # Override initialzer to avoid deprecation about not providing base path
    def initializer
      # nop
    end

    def pattern(id)
      uploaded_file = Spotlight::FeaturedImage.find(id).image.file
      raise Riiif::ImageNotFoundError, "unable to find file for #{id}" if uploaded_file.nil?

      uploaded_file.file
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blacklight-spotlight-2.3.2 app/services/spotlight/carrierwave_file_resolver.rb
blacklight-spotlight-2.3.1 app/services/spotlight/carrierwave_file_resolver.rb
blacklight-spotlight-2.3.0 app/services/spotlight/carrierwave_file_resolver.rb