Sha256: a9a08adbb992a1c538ed1cc7c852a303f2bc98c300ecdb077b8caba862f3a5b0
Contents?: true
Size: 466 Bytes
Versions: 10
Compression:
Stored size: 466 Bytes
Contents
# frozen_string_literal: true module Decidim module Plans class AttachmentForm < Decidim::Form attribute :title, String attribute :file attribute :weight, Integer attribute :deleted, Boolean, default: false mimic :attachment validates :title, presence: true, if: ->(form) { form.file.present? || form.id.present? } def to_param return id if id.present? "attachment-id" end end end end
Version data entries
10 entries across 10 versions & 1 rubygems