ManageIQ/manageiq-api

View on GitHub
app/controllers/api/base_controller/parameters.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Use filter_map instead.
Open

        params['sort_by'].split(",").zip(orders).collect do |attr, order|
          if klass.virtual_attribute?(attr) && !klass.attribute_supported_by_sql?(attr)
            raise BadRequestError, "#{klass.name} cannot be sorted by #{attr}"
          elsif klass.attribute_supported_by_sql?(attr)
            sort_directive(klass, attr, order, options)

Use filter_map instead.
Open

        Array(attribute_selection).collect do |attr|
          /\A#{collection}\.(?<name>.*)\z/.match(attr) { |m| m[:name] }
        end.compact

There are no issues that match your filters.

Category
Status