• 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/licences_controller.rb
1
# frozen_string_literal: true
2

3
# API Controller for resources of type Licence
4
# Licenses are used in Projects
5
class API::LicencesController < API::APIController
×
6
  before_action :authenticate_user!, except: %i[index show]
×
7
  before_action :set_licence, only: %i[show update destroy]
×
8

9
  def index
×
10
    @licences = Licence.all
×
11
  end
×
12

13
  def show; end
×
14

15
  def create
×
16
    authorize Licence
×
17
    @licence = Licence.new(licence_params)
×
18
    if @licence.save
×
19
      render :show, status: :created, location: @licence
×
20
    else
×
21
      render json: @licence.errors, status: :unprocessable_entity
×
22
    end
×
23
  end
×
24

25
  def update
×
26
    authorize Licence
×
27
    if @licence.update(licence_params)
×
28
      render :show, status: :ok, location: @licence
×
29
    else
×
30
      render json: @licence.errors, status: :unprocessable_entity
×
31
    end
×
32
  end
×
33

34
  def destroy
×
35
    authorize Licence
×
36
    @licence.destroy
×
37
    head :no_content
×
38
  end
×
39

40
  private
×
41

42
  def set_licence
×
43
    @licence = Licence.find(params[:id])
×
44
  end
×
45

46
  def licence_params
×
47
    params.require(:licence).permit(:name, :description)
×
48
  end
×
49
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