Skip to content

Commit 3b1f4cd

Browse files
adamruzickaclaude
andcommitted
Refs #39464 - Inline pattern_template_invocations in show
The before_action was only used by the show action, so inline the assignment rather than extracting a separate method. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f0bcdec commit 3b1f4cd

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

app/controllers/api/v2/job_invocations_controller.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class JobInvocationsController < ::Api::V2::BaseController
88
before_action :find_optional_nested_object, :only => %w{output raw_output}
99
before_action :find_host, :only => %w{output raw_output}
1010
before_action :find_resource, :only => %w{show update destroy clone cancel rerun outputs hosts}
11-
before_action :find_pattern_template_invocations, :only => %w{show hosts}
1211

1312
wrap_parameters JobInvocation, :include => (JobInvocation.attribute_names + [:ssh])
1413

@@ -21,6 +20,7 @@ def index
2120
api :GET, '/job_invocations/:id', N_('Show job invocation')
2221
param :id, :identifier, :required => true
2322
def show
23+
@pattern_template_invocations = @job_invocation.pattern_template_invocations.includes(:input_values)
2424
@job_organization = Taxonomy.find_by(id: @job_invocation.task.input[:current_organization_id])
2525
@job_location = Taxonomy.find_by(id: @job_invocation.task.input[:current_location_id])
2626
end
@@ -292,10 +292,6 @@ def parent_scope
292292
resource_class.where(nil)
293293
end
294294

295-
def find_pattern_template_invocations
296-
@pattern_template_invocations = @job_invocation.pattern_template_invocations.includes(:input_values)
297-
end
298-
299295
def set_hosts_and_template_invocations
300296
@hosts = @job_invocation.targeting.hosts.authorized(:view_hosts, Host)
301297

0 commit comments

Comments
 (0)