Module: Ddr::Models::HasThumbnail

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/ddr/models/has_thumbnail.rb

Instance Method Summary collapse

Instance Method Details

#copy_thumbnail_from(other) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/ddr/models/has_thumbnail.rb', line 17

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

#thumbnail_changed?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/ddr/models/has_thumbnail.rb', line 13

def thumbnail_changed?
  thumbnail.content_changed?
end