Class: Cdx::Asset

Inherits:
ApplicationRecord show all
Defined in:
app/models/cdx/asset.rb

Constant Summary collapse

IMAGE_CONTENT_TYPE =
%w(image/jpeg image/jpg image/png image/gif).freeze

Instance Method Summary collapse

Methods included from AttachmentMacros

#has_many_attached, #has_one_attached

Instance Method Details

#image?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/models/cdx/asset.rb', line 7

def image?
  IMAGE_CONTENT_TYPE.include? attachment_content_type
end