• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sleede / fab-manager / #106

pending completion
#106

push

coveralls-ruby

sylvainbx
Merge branch 'dev' for release 6.0.0

704 of 704 new or added lines in 168 files covered. (100.0%)

7919 of 13474 relevant lines covered (58.77%)

15.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/app/controllers/api/supporting_document_types_controller.rb
1
# frozen_string_literal: true
2

3
# API Controller for resources of type SupportingDocumentType
4
# ProofOfIdentityTypes are used to provide admin config proof of identity type by group
5
class API::SupportingDocumentTypesController < API::APIController
×
6
  before_action :authenticate_user!, except: :index
×
7
  before_action :set_supporting_document_type, only: %i[show update destroy]
×
8

9
  def index
×
10
    @supporting_document_types = SupportingDocumentTypeService.list(params)
×
11
  end
×
12

13
  def show; end
×
14

15
  def create
×
16
    authorize SupportingDocumentType
×
17
    @supporting_document_type = SupportingDocumentType.new(supporting_document_type_params)
×
18
    if @supporting_document_type.save
×
19
      render status: :created
×
20
    else
×
21
      render json: @supporting_document_type.errors.full_messages, status: :unprocessable_entity
×
22
    end
×
23
  end
×
24

25
  def update
×
26
    authorize @supporting_document_type
×
27

28
    if @supporting_document_type.update(supporting_document_type_params)
×
29
      render status: :ok
×
30
    else
×
31
      render json: @supporting_document_type.errors.full_messages, status: :unprocessable_entity
×
32
    end
×
33
  end
×
34

35
  def destroy
×
36
    authorize @supporting_document_type
×
37
    @supporting_document_type.destroy
×
38
    head :no_content
×
39
  end
×
40

41
  private
×
42

43
  def set_supporting_document_type
×
44
    @supporting_document_type = SupportingDocumentType.find(params[:id])
×
45
  end
×
46

47
  def supporting_document_type_params
×
48
    params.require(:supporting_document_type).permit(:name, group_ids: [])
×
49
  end
×
50
end
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc