Sha256: aa8afe4c968d13ce88a55efe32349a7cd6deec349c3929511b6148070f2b5453
Contents?: true
Size: 544 Bytes
Versions: 19
Compression:
Stored size: 544 Bytes
Contents
# encoding: utf-8 module ConstructorPages module Types # Image type. Render select file field. class ImageType < ActiveRecord::Base belongs_to :field belongs_to :page, touch: true image_accessor :value validates :value, presence: true # Max size is 5 MB validates_size_of :value, maximum: 5.megabytes, message: :incorrect_size # Accept only jpeg, png, gif validates_property :mime_type, of: :value, in: %w(image/jpeg image/png image/gif), message: :incorrect_format end end end
Version data entries
19 entries across 19 versions & 1 rubygems