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.8 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.7 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.6 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.5 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.4 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.3 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.2 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.1 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.rc6 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.rc5 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.rc4 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.rc3 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.rc2 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.rc1 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.beta.22 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.beta.21 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.beta.20 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.beta.18 lib/ddr/models/has_thumbnail.rb
ddr-models-3.0.0.beta.17 lib/ddr/models/has_thumbnail.rb