diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-17 01:33:09 +0900 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-30 23:55:09 +0900 |
commit | e828e835e435deab8a62c7c999dca0b774e7a7d6 (patch) | |
tree | 77d0f0f8c662e8a61bec81c57fcc09b0e23483ec /lib | |
parent | 94f7595b9a8edcb4ac8480995a067eb4fa3dec7e (diff) | |
download | gitlab-ce-e828e835e435deab8a62c7c999dca0b774e7a7d6.tar.gz |
avoids N + 1 queries
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/pipeline_schedules.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/pipeline_schedules.rb b/lib/api/pipeline_schedules.rb index 2319ff639e5..9429306fe20 100644 --- a/lib/api/pipeline_schedules.rb +++ b/lib/api/pipeline_schedules.rb @@ -17,7 +17,7 @@ module API get ':id/pipeline_schedules' do authorize! :read_pipeline_schedule, user_project - pipeline_schedules = user_project.pipeline_schedules + pipeline_schedules = user_project.pipeline_schedules.preload(:pipelines) present paginate(pipeline_schedules), with: Entities::PipelineSchedule end |