Sha256: b7e77eeba98a9c970cec65e5b6369a4ba3bae78ee86022fb3966809c1498c63e

Contents?: true

Size: 630 Bytes

Versions: 4

Compression:

Stored size: 630 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module DecidimAwesome
    module Admin
      class ConstraintForm < Decidim::Form
        attribute :id, Integer
        attribute :participatory_space_manifest, String
        attribute :participatory_space_slug, String
        attribute :component_manifest, String
        attribute :component_id, Integer

        validates :component_manifest, absence: true, if: ->(form) { form.component_id.present? || form.participatory_space_manifest == "system" }
        validates :component_id, absence: true, if: ->(form) { form.component_manifest.present? }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
decidim-decidim_awesome-0.7.0 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.6.7 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.6.6 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.6.5 app/forms/decidim/decidim_awesome/admin/constraint_form.rb