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

sleede / fab-manager / #98

pending completion
#98

push

coveralls-ruby

sylvainbx
Merge branch 'dev' for release 5.7.0

1368 of 1368 new or added lines in 161 files covered. (100.0%)

7383 of 12030 relevant lines covered (61.37%)

14.06 hits per line

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

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

3
# API Controller for resources of type ProfileCustomField
4
# ProfileCustomFields are fields configured by an admin, added to the user's profile
5
class API::ProfileCustomFieldsController < API::ApiController
×
6
  before_action :authenticate_user!, except: :index
×
7
  before_action :set_profile_custom_field, only: %i[show update destroy]
×
8

9
  def index
×
10
    @profile_custom_fields = ProfileCustomField.all.order('id ASC')
×
11
    @profile_custom_fields = @profile_custom_fields.where(actived: params[:actived]) if params[:actived].present?
×
12
  end
×
13

14
  def show; end
×
15

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

26
  def update
×
27
    authorize @profile_custom_field
×
28

29
    if @profile_custom_field.update(profile_custom_field_params)
×
30
      render status: :ok
×
31
    else
×
32
      render json: @pack.errors.full_messages, status: :unprocessable_entity
×
33
    end
×
34
  end
×
35

36
  def destroy
×
37
    authorize @profile_custom_field
×
38
    @profile_custom_field.destroy
×
39
    head :no_content
×
40
  end
×
41

42
  private
×
43

44
  def set_profile_custom_field
×
45
    @profile_custom_field = ProfileCustomField.find(params[:id])
×
46
  end
×
47

48
  def profile_custom_field_params
×
49
    params.require(:profile_custom_field).permit(:label, :required, :actived)
×
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

© 2026 Coveralls, Inc