Sha256: c73432554d1b9ec49761750d3a0154b442847c45145df7203d8bf56e30436910

Contents?: true

Size: 564 Bytes

Versions: 6

Compression:

Stored size: 564 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Proposals
    # A form object to be used when public users want to request access 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

6 entries across 6 versions & 1 rubygems

Version Path
decidim-proposals-0.29.1 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.29.0 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.29.0.rc4 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.29.0.rc3 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.29.0.rc2 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb
decidim-proposals-0.29.0.rc1 app/forms/decidim/proposals/request_access_to_collaborative_draft_form.rb