Sha256: ef0796295063c74a0409df1449b9416a0adeaf4dccab494bfb8d92c7fad45319

Contents?: true

Size: 591 Bytes

Versions: 34

Compression:

Stored size: 591 Bytes

Contents

module Spotlight
  ##
  # Exhibit contact profile pictures
  class AvatarUploader < CarrierWave::Uploader::Base
    include CarrierWave::MiniMagick

    storage Spotlight::Engine.config.uploader_storage

    version :thumb do
      process crop: :avatar ## Crops this version based on original image
      resize_to_limit(70, 70)
    end

    # Override the directory where uploaded files will be stored.
    # This is a sensible default for uploaders that are meant to be mounted:
    def store_dir
      "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
blacklight-spotlight-0.20.3 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.20.2 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.20.1 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.20.0 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.19.2 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.19.1 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.19.0 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.18.0 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.17.1 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.17.0 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.16.0 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.15.0 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.14.2 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.14.1 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.14.0 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.13.0 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.12.1 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.12.0 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.11.0 app/uploaders/spotlight/avatar_uploader.rb
blacklight-spotlight-0.10.3 app/uploaders/spotlight/avatar_uploader.rb