Class: Katello::Api::V2::GenericContentUnitsController

Inherits:
ApiController
  • Object
show all
Includes:
Concerns::Api::V2::RepositoryContentController
Defined in:
app/controllers/katello/api/v2/generic_content_units_controller.rb

Instance Method Summary collapse

Methods inherited from ApiController

#check_katello_agent_not_disabled, #deprecate_katello_agent, #empty_search_query?, #full_result_response, #katello_agent_removal_release, #scoped_search, #skip_session

Methods included from Rendering

#respond_for_async, #respond_for_bulk_async, #respond_for_create, #respond_for_destroy, #respond_for_index, #respond_for_show, #respond_for_status, #respond_for_update, #respond_with_template, #respond_with_template_collection, #respond_with_template_resource, #try_specific_collection_template, #try_specific_resource_template

Methods included from Katello::Api::Version2

#api_version

Instance Method Details

#default_sortObject



17
18
19
# File 'app/controllers/katello/api/v2/generic_content_units_controller.rb', line 17

def default_sort
  %w(name asc)
end

#resource_classObject



21
22
23
24
# File 'app/controllers/katello/api/v2/generic_content_units_controller.rb', line 21

def resource_class
  fail "Required param content_type is missing" unless params[:content_type]
  ::Katello::GenericContentUnit.where(content_type: params[:content_type].singularize)
end