Sha256: c7c439282a06b4b3870063e4ed84be8fc9914fd2868d8a025b95d12d4d394eae

Contents?: true

Size: 577 Bytes

Versions: 6

Compression:

Stored size: 577 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module EnhancedTextwork
    # 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::EnhancedTextwork::CollaborativeDraft.find id
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-enhanced_textwork-1.0.5 app/forms/decidim/enhanced_textwork/request_access_to_collaborative_draft_form.rb
decidim-enhanced_textwork-1.0.4 app/forms/decidim/enhanced_textwork/request_access_to_collaborative_draft_form.rb
decidim-enhanced_textwork-1.0.3 app/forms/decidim/enhanced_textwork/request_access_to_collaborative_draft_form.rb
decidim-enhanced_textwork-1.0.2 app/forms/decidim/enhanced_textwork/request_access_to_collaborative_draft_form.rb
decidim-enhanced_textwork-1.0.1 app/forms/decidim/enhanced_textwork/request_access_to_collaborative_draft_form.rb
decidim-enhanced_textwork-1.0.0 app/forms/decidim/enhanced_textwork/request_access_to_collaborative_draft_form.rb