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

3
# API Controller for resources of type OpenAPI::Client
4
# OpenAPI::Clients are used to allow access to the public API
5
class API::OpenAPIClientsController < API::APIController
×
6
  before_action :authenticate_user!
×
7

8
  def index
×
9
    authorize OpenAPI::Client
×
10
    @clients = OpenAPI::Client.order(:created_at)
×
11
  end
×
12

13
  def create
×
14
    @client = OpenAPI::Client.new(client_params)
×
15
    authorize @client
×
16
    if @client.save
×
17
      render status: :created
×
18
    else
×
19
      render json: @client.errors, status: :unprocessable_entity
×
20
    end
×
21
  end
×
22

23
  def update
×
24
    @client = OpenAPI::Client.find(params[:id])
×
25
    authorize @client
×
26
    if @client.update(client_params)
×
27
      render status: :ok
×
28
    else
×
29
      render json: @client.errors, status: :unprocessable_entity
×
30
    end
×
31
  end
×
32

33
  def reset_token
×
34
    @client = OpenAPI::Client.find(params[:id])
×
35
    authorize @client
×
36
    @client.regenerate_token
×
37
  end
×
38

39
  def destroy
×
40
    @client = OpenAPI::Client.find(params[:id])
×
41
    authorize @client
×
42
    @client.destroy
×
43
    head :no_content
×
44
  end
×
45

46
  private
×
47

48
  def client_params
×
49
    params.require(:open_api_client).permit(:name)
×
50
  end
×
51
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