Sha256: e5d0b3a50cb33e0f817c0c1eb42b6b864e4b44443c280b4c962e51ac01fb8168
Contents?: true
Size: 503 Bytes
Versions: 59
Compression:
Stored size: 503 Bytes
Contents
# frozen_string_literal: true module Decidim # A form object used to create attachments. # class AttachmentForm < Form include Decidim::HasUploadValidations attribute :title, String attribute :file attribute :delete_file, Boolean mimic :attachment validates :title, presence: true, if: ->(form) { form.file.present? } validates :file, passthru: { to: Decidim::Attachment }, if: ->(form) { form.file.present? } alias organization current_organization end end
Version data entries
59 entries across 59 versions & 1 rubygems