• 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/pricing_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 Plans prices
6
class API::PricingController < API::APIController
×
7
  include ApplicationHelper
×
8

9
  before_action :authenticate_user!, except: %i[index update]
×
10

11
  def index
×
12
    @group_pricing = Group.includes(:plans, :trainings_pricings)
×
13
  end
×
14

15
  def update
×
16
    authorize :pricing, :update?
×
17
    if params[:training].present?
×
18
      training = Training.find params[:training]
×
19
      params[:group_pricing].each do |group_id, amount|
×
20
        next unless training
×
21

22
        group = Group.includes(:plans).find(group_id)
×
23
        next unless group
×
24

25
        training_pricing = group.trainings_pricings.find_or_initialize_by(training_id: training.id)
×
26
        training_pricing.amount = to_centimes(amount)
×
27
        training_pricing.save
×
28
      end
×
29
    end
×
30
    head :ok
×
31
  end
×
32
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