Sha256: 730078a950148115b8dd82a9239de8760eed77d09ceb3db0bb980e8bfc32d3c9

Contents?: true

Size: 515 Bytes

Versions: 27

Compression:

Stored size: 515 Bytes

Contents

module Ddr::Models
  module HasThumbnail
    extend ActiveSupport::Concern

    included do
      contains Ddr::Models::File::THUMBNAIL, class_name: "Ddr::Models::File"
    end

    def thumbnail_changed?
      thumbnail.content_changed?
    end

    def copy_thumbnail_from(other)
      if other && other.has_thumbnail?
        self.thumbnail.content = other.thumbnail.content
        self.thumbnail.mime_type = other.thumbnail.mime_type if thumbnail_changed?
      end
      thumbnail_changed?
    end

  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ddr-models-3.0.0.beta.16 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.beta.15 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.beta.14 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.beta.13 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.beta.12 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.beta.11 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.beta.10 lib/ddr/models/has_thumbnail.rb