Sha256: 1505aaf49a04278508d622bbed81911f9414314d0a7295a4d773438bf8ef824c
Contents?: true
Size: 794 Bytes
Versions: 28
Compression:
Stored size: 794 Bytes
Contents
# frozen_string_literal: true class Image < ApplicationRecord include DynamicImage::Model include PagesCore::Sweepable validate :ensure_max_size, on: :create localizable do attribute :alternative attribute :caption end def byline ActiveSupport::Deprecation.warn "Image#byline is deprecated, use #caption" caption end def byline? ActiveSupport::Deprecation.warn "Image#byline? is deprecated, use #caption?" caption? end def byline=(new_caption) ActiveSupport::Deprecation.warn "Image#byline= is deprecated, use #caption=" self.caption = new_caption end private def ensure_max_size return unless real_width? && real_height? return if real_width * real_height <= 48_000_000 errors.add(:data, "is too large") end end
Version data entries
28 entries across 28 versions & 1 rubygems