Sha256: 59fb1be07639f7d05bf161b693778fbfa5ea1d7b2dcb9637c756f454af6d3c93

Contents?: true

Size: 563 Bytes

Versions: 72

Compression:

Stored size: 563 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Proposals
    # A form object to be used when public users want to request acces to a Collaborative Draft.
    class RequestAccessToCollaborativeDraftForm < Decidim::Form
      mimic :collaborative_draft

      attribute :id, String
      attribute :state, String

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

      def collaborative_draft
        @collaborative_draft ||= Decidim::Proposals::CollaborativeDraft.find id
      end
    end
  end
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
decidim-proposals-0.24.2 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.23.5 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.24.1 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.24.0 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.24.0.rc2 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.23.4 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.24.0.rc1 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.23.3 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.23.2 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.23.1 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.23.1.rc1 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.23.0 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.22.0 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.21.0 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.20.1 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.20.0 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.19.1 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.18.1 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.19.0 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.17.2 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb