Sha256: d4c9efeac5ade8d8fd7bd2ebc029d45c8995487a70b059cab45eb8cc77967b81

Contents?: true

Size: 283 Bytes

Versions: 67

Compression:

Stored size: 283 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # A form object used to create attachments.
  #
  class AttachmentForm < Form
    attribute :title, String
    attribute :file

    mimic :attachment

    validates :title, presence: true, if: ->(form) { form.file.present? }
  end
end

Version data entries

67 entries across 67 versions & 2 rubygems

Version Path
decidim-core-0.12.2 app/forms/decidim/attachment_form.rb
decidim-core-0.13.0 app/forms/decidim/attachment_form.rb
decidim-core-0.12.1 app/forms/decidim/attachment_form.rb
decidim-core-0.13.0.pre1 app/forms/decidim/attachment_form.rb
decidim-core-0.12.0 app/forms/decidim/attachment_form.rb
decidim-core-0.11.2 app/forms/decidim/attachment_form.rb
decidim-core-0.12.0.pre app/forms/decidim/attachment_form.rb
decidim-core-0.11.1 app/forms/decidim/attachment_form.rb
decidim-core-0.11.0.pre1 app/forms/decidim/attachment_form.rb
decidim-core-0.10.1 app/forms/decidim/attachment_form.rb
decidim-core-0.10.0 app/forms/decidim/attachment_form.rb
decidim-core-0.9.3 app/forms/decidim/attachment_form.rb
decidim-core-0.9.2 app/forms/decidim/attachment_form.rb
decidim-core-0.9.1 app/forms/decidim/attachment_form.rb
decidim-core-0.9.0 app/forms/decidim/attachment_form.rb
decidim-core-0.8.4 app/forms/decidim/attachment_form.rb
decidim-core-0.8.3 app/forms/decidim/attachment_form.rb
decidim-core-0.8.2 app/forms/decidim/attachment_form.rb
decidim-core-0.8.1 app/forms/decidim/attachment_form.rb
decidim-core-0.8.0 app/forms/decidim/attachment_form.rb