Class: Admin::Packages::PricingGroupsController

Inherits:
BaseController
  • Object
show all
Includes:
AdminPackageConcern
Defined in:
app/controllers/admin/packages/pricing_groups_controller.rb

Overview

typed: ignore

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/admin/packages/pricing_groups_controller.rb', line 4

def index
  pricing_groups = (if package.pricing_groups.present?
                      package.pricing_groups
                    elsif package.respond_to? :build_pricing_groups
                      package.build_pricing_groups
                    else
                      [package.pricing_groups.build]
                    end)

  render json: pricing_groups
end