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.21.0 app/forms/decidim/attachment_form.rb
decidim-core-0.20.1 app/forms/decidim/attachment_form.rb
decidim-core-0.20.0 app/forms/decidim/attachment_form.rb
decidim-core-0.19.1 app/forms/decidim/attachment_form.rb
decidim-core-0.18.1 app/forms/decidim/attachment_form.rb
decidim-core-0.19.0 app/forms/decidim/attachment_form.rb
decidim-core-0.17.2 app/forms/decidim/attachment_form.rb
decidim-core-0.18.0 app/forms/decidim/attachment_form.rb
decidim-core-0.17.1 app/forms/decidim/attachment_form.rb
decidim-core-0.16.1 app/forms/decidim/attachment_form.rb
decidim-core-0.17.0 app/forms/decidim/attachment_form.rb
decidim-core-0.16.0 app/forms/decidim/attachment_form.rb
decidim-core-0.15.2 app/forms/decidim/attachment_form.rb
decidim-core-0.15.1 app/forms/decidim/attachment_form.rb
decidim-core-0.15.0 app/forms/decidim/attachment_form.rb
decidim-core-0.14.4 app/forms/decidim/attachment_form.rb
decidim-core-0.14.3 app/forms/decidim/attachment_form.rb
decidim-core-0.14.2 app/forms/decidim/attachment_form.rb
decidim-core-0.14.1 app/forms/decidim/attachment_form.rb
decidim-core-0.13.1 app/forms/decidim/attachment_form.rb