Sha256: b6d26499e5b5bc5c89f82fbf7f2215a1f8404b3f8492ab1787542ca87e4e2486
Contents?: true
Size: 1.17 KB
Versions: 6
Compression:
Stored size: 1.17 KB
Contents
# frozen_string_literal: true module Decidim module NavigationMaps # A form object used to configure the blueprint content block from the admin panel. # class BlueprintForm < Decidim::Form include TranslatableAttributes mimic :blueprint attribute :blueprint, Object attribute :id, Integer attribute :decidim_content_block_id, Integer attribute :remove, Boolean attribute :image translatable_attribute :title, String translatable_attribute :description, String attribute :height, Integer # validate :check_image_or_blueprint validates :title, translatable_presence: true validates :height, numericality: { greater_than: 0 } # def check_image_or_blueprint # return if image.present? || blueprint.present? # errors.add(:image, "no image") unless image.present? # errors.add(:blueprint, "no blueprint") unless blueprint.present? # end def ident id || "_" end def image? return unless image && image.respond_to?(:url) return image.content_type.start_with? "image" if image.content_type.present? end end end end
Version data entries
6 entries across 6 versions & 1 rubygems