Sha256: 44f81d896dbabf61eacb7ac20d35e4279d57035eb9775b682ba97b56e24b88eb

Contents?: true

Size: 570 Bytes

Versions: 19

Compression:

Stored size: 570 Bytes

Contents

module Spotlight
  ###
  #  Simple concern to mixin to classes that
  #  fetches a default thumbnail after creation
  #  Classes that mixin this module should implement
  #  a set_default_thumbnail method themselves
  ###
  module DefaultThumbnailable
    extend ActiveSupport::Concern

    included do
      after_create(:fetch_default_thumb_later) if respond_to?(:after_create)
    end

    private

    def fetch_default_thumb_later
      DefaultThumbnailJob.perform_later(self)
    end

    def set_default_thumbnail
      fail NotImplementedError
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
blacklight-spotlight-0.17.0 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.16.0 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.15.0 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.14.2 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.14.1 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.14.0 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.13.0 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.12.1 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.12.0 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.11.0 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.10.3 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.10.2 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.10.1 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.10.0 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.9.2 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.9.1 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.9.0 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.8.2 app/models/concerns/spotlight/default_thumbnailable.rb
blacklight-spotlight-0.8.1 app/models/concerns/spotlight/default_thumbnailable.rb