Replace remaining AvailableServices.find_by_name calls

Goal

Replace all remaining AvailableServices.find_by_name calls with unit_primitive_name.to_sym. Most of these are simple replacements since they only call AiGateway client header methods which ultimately call user.allowed_to_use from UserAuthorizable.

This will remove the last need for callers to locate service objects.

Rollout

Step 0: Prepare

Complete

Temporarily patch AiGateway.headers to accept a UP symbol for service arguments (see snippet). This allows us to start cutting over to passing UP names at the call site instead of a service object.

Step 1: Cutting over

In progress

Update all call sites to pass UP names instead of service objects. This work can happen in parallel.

Files to change:

Step 2: Cleaning up - @alipniagov - WIP - !203830 (merged)

  • Remove the temporary workaround that accepts both service objects and UP names. We only accept UP names now.
  • Rename the service parameter to unit_primitive_name
Edited by Matthias Käppler