Commit 62919a17 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Update tests and associations

parent b828a98c
......@@ -13,15 +13,16 @@ class PipelineSerializer < BaseSerializer
def represent(resource, opts = {})
if resource.is_a?(ActiveRecord::Relation)
resource = resource.includes(:project)
resource = resource.includes(:pending_builds,
:retryable_builds,
:cancelable_statuses,
:manual_actions,
:artifacts)
:artifacts,
:trigger_requests)
resource = resource.includes(pending_builds: :project)
resource = resource.includes(manual_actions: :project)
resource = resource.includes(artifacts: :project)
resource = resource.includes(project: :namespace)
resource = resource.includes(manual_actions: { project: :namespace })
resource = resource.includes(artifacts: { project: :namespace })
end
if paginated?
......
......@@ -101,6 +101,13 @@ describe PipelineSerializer do
Ci::Pipeline::AVAILABLE_STATUSES.each do |status|
create_pipeline(status)
end
RequestStore.begin!
end
after do
RequestStore.end!
RequestStore.clear!
end
it "verifies number of queries" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment