Sha256: 53787e1852ef8dae1749e15b6c807b8b0ebd824c4e9703c1a28ce354438a9814

Contents?: true

Size: 632 Bytes

Versions: 5

Compression:

Stored size: 632 Bytes

Contents

# encoding: utf-8
module Spotlight
  ##
  # Exhibit and browse category custom mastheads
  class MastheadUploader < CarrierWave::Uploader::Base
    include CarrierWave::MiniMagick
    storage Spotlight::Engine.config.uploader_storage

    version :cropped do
      process crop: :image ## Crops this version based on original image
      process resize_to_fill: [1800, 180]
    end

    def store_dir
      "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end

    def default_url
      ActionController::Base.helpers.asset_path('fallback/' + [version_name, 'default.png'].compact.join('_'))
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
blacklight-spotlight-0.25.0 app/uploaders/spotlight/masthead_uploader.rb
blacklight-spotlight-0.24.0 app/uploaders/spotlight/masthead_uploader.rb
blacklight-spotlight-0.23.0 app/uploaders/spotlight/masthead_uploader.rb
blacklight-spotlight-0.22.0 app/uploaders/spotlight/masthead_uploader.rb
blacklight-spotlight-0.21.0 app/uploaders/spotlight/masthead_uploader.rb