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

3
# API Controller for resources of type PriceCategory
4
# PriceCategories are used in Events
5
class API::PriceCategoriesController < API::APIController
×
6
  before_action :authenticate_user!, only: %i[update show create destroy]
×
7
  before_action :set_price_category, only: %i[show update destroy]
×
8

9
  def index
×
10
    @price_categories = PriceCategory.all
×
11
  end
×
12

13
  def update
×
14
    authorize PriceCategory
×
15
    if @price_category.update(price_category_params)
×
16
      render :show, status: :ok, location: @price_category
×
17
    else
×
18
      render json: @price_category.errors, status: :unprocessable_entity
×
19
    end
×
20
  end
×
21

22
  def show; end
×
23

24
  def create
×
25
    authorize PriceCategory
×
26
    @price_category = PriceCategory.new(price_category_params)
×
27
    if @price_category.save
×
28
      render :show, status: :created, location: @price_category
×
29
    else
×
30
      render json: @price_category.errors, status: :unprocessable_entity
×
31
    end
×
32
  end
×
33

34
  def destroy
×
35
    authorize PriceCategory
×
36
    if @price_category.safe_destroy
×
37
      head :no_content
×
38
    else
×
39
      render json: @price_category.errors, status: :unprocessable_entity
×
40
    end
×
41
  end
×
42

43
  private
×
44

45
  def set_price_category
×
46
    @price_category = PriceCategory.find(params[:id])
×
47
  end
×
48

49
  def price_category_params
×
50
    params.require(:price_category).permit(:name, :conditions)
×
51
  end
×
52
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