Sha256: 14058594e421f7ea8e43fbed454bbb548739ebe58a9a045b18b63be3f910b28b

Contents?: true

Size: 705 Bytes

Versions: 27

Compression:

Stored size: 705 Bytes

Contents

module Ddr
  module Models
    module HasThumbnail
      extend ActiveSupport::Concern
  
      included do
        has_file_datastream name: Ddr::Datastreams::THUMBNAIL, 
                            versionable: true, 
                            label: "Thumbnail for this object", 
                            control_group: 'M'
      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.mimeType = other.thumbnail.mimeType if thumbnail_changed?
        end
        thumbnail_changed?
      end

    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ddr-models-1.13.2 lib/ddr/models/has_thumbnail.rb
ddr-models-1.13.1 lib/ddr/models/has_thumbnail.rb
ddr-models-1.13.0 lib/ddr/models/has_thumbnail.rb
ddr-models-1.11.8 lib/ddr/models/has_thumbnail.rb
ddr-models-1.12.3 lib/ddr/models/has_thumbnail.rb
ddr-models-1.11.7 lib/ddr/models/has_thumbnail.rb
ddr-models-1.12.2 lib/ddr/models/has_thumbnail.rb
ddr-models-1.11.6 lib/ddr/models/has_thumbnail.rb
ddr-models-1.12.1 lib/ddr/models/has_thumbnail.rb
ddr-models-1.11.5 lib/ddr/models/has_thumbnail.rb
ddr-models-1.12.0 lib/ddr/models/has_thumbnail.rb
ddr-models-1.11.4 lib/ddr/models/has_thumbnail.rb
ddr-models-1.11.3 lib/ddr/models/has_thumbnail.rb
ddr-models-1.11.2 lib/ddr/models/has_thumbnail.rb
ddr-models-1.11.1 lib/ddr/models/has_thumbnail.rb
ddr-models-1.11.0 lib/ddr/models/has_thumbnail.rb
ddr-models-1.10.0 lib/ddr/models/has_thumbnail.rb
ddr-models-1.9.0 lib/ddr/models/has_thumbnail.rb
ddr-models-1.8.1 lib/ddr/models/has_thumbnail.rb
ddr-models-1.8.0 lib/ddr/models/has_thumbnail.rb