Project

General

Profile

Revision 367f39d2

Added by Sebastian Gräßl over 5 years ago

Fixes #19694 - Align rubocop configuration with foreman-core

And fix offenses

View differences:

app/controllers/api/v2/containers_controller.rb
17 17
      param_group :search_and_pagination, ::Api::V2::BaseController
18 18

  
19 19
      def index
20
        if params[:compute_resource_id].present?
21
          scoped = Container.where(:compute_resource_id => params[:compute_resource_id])
22
        else
23
          scoped = Container.where(nil)
20
        compute_resource_id = params[:compute_resource_id].tap do |id|
21
          id.present? ? { :compute_resource_id => id } : nil
24 22
        end
23
        scoped = Container.where(compute_resource_id)
25 24
        @containers = scoped.search_for(params[:search], :order => params[:order])
26 25
                      .paginate(:page => params[:page])
27 26
      end

Also available in: Unified diff