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-0.6.1 decidim-core/app/forms/decidim/attachment_form.rb
decidim-core-0.6.0 app/forms/decidim/attachment_form.rb
decidim-0.6.0 decidim-core/app/forms/decidim/attachment_form.rb
decidim-core-0.5.1 app/forms/decidim/attachment_form.rb
decidim-0.5.1 decidim-core/app/forms/decidim/attachment_form.rb
decidim-core-0.5.0 app/forms/decidim/attachment_form.rb
decidim-0.5.0 decidim-core/app/forms/decidim/attachment_form.rb