Sha256: 7777e843ecb719ee51350e31f7258179aa7c8709395fdd5ef81d7830173be82f

Contents?: true

Size: 467 Bytes

Versions: 16

Compression:

Stored size: 467 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Plans
    # A form object to be used when public users want to request acces to a Plan.
    class RequestAccessToPlanForm < Decidim::Form
      mimic :plan

      attribute :id, String
      attribute :state, String

      validates :id, presence: true
      validates :state, presence: true, inclusion: { in: %w(open) }

      def plan
        @plan ||= Decidim::Plans::Plan.find id
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
decidim-plans-0.18.2 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.18.1 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.18.0 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.17.0 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.16.9 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.16.8 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.16.7 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.16.6 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.16.5 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.16.4 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.16.3 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.16.2 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.16.1 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.16.0 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.15.1 app/forms/decidim/plans/request_access_to_plan_form.rb
decidim-plans-0.15.0 app/forms/decidim/plans/request_access_to_plan_form.rb