Sha256: 2fd59437f15c202e0de5fde6ae51b566219c9f91ac04a9eeee29e422189c528f

Contents?: true

Size: 701 Bytes

Versions: 13

Compression:

Stored size: 701 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: lambda { |form|
          form.component_id.present? || ConfigConstraintsHelpers::OTHER_MANIFESTS.include?(form.participatory_space_manifest&.to_sym)
        }
        validates :component_id, absence: true, if: ->(form) { form.component_manifest.present? }
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-decidim_awesome-0.10.3 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.11.2 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.11.1 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.10.2 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.10.1 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.10.0 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.9.3 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.9.1 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.8.3 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.8.2 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.8.1 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.8.0 app/forms/decidim/decidim_awesome/admin/constraint_form.rb
decidim-decidim_awesome-0.7.2 app/forms/decidim/decidim_awesome/admin/constraint_form.rb