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

3
# @deprecated
4
# <b>DEPRECATED:</b> Please use <tt>API::PriceController</tt> instead.
5
# API Controller for managing Training prices
6
class API::TrainingsPricingsController < API::APIController
×
7
  include ApplicationHelper
×
8

9
  before_action :authenticate_user!
×
10

11
  def index
×
12
    @trainings_pricings = TrainingsPricing.all
×
13
  end
×
14

15
  def update
×
16
    if current_user.admin?
×
17
      @trainings_pricing = TrainingsPricing.find(params[:id])
×
18
      trainings_pricing_parameters = trainings_pricing_params
×
19
      trainings_pricing_parameters[:amount] = to_centimes(trainings_pricing_parameters[:amount])
×
20
      if @trainings_pricing.update(trainings_pricing_parameters)
×
21
        render status: :ok
×
22
      else
×
23
        render status: :unprocessable_entity
×
24
      end
×
25
    else
×
26
      head :forbidden
×
27
    end
×
28
  end
×
29

30
  def trainings_pricing_params
×
31
    params.require(:trainings_pricing).permit(:amount)
×
32
  end
×
33
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