From 426f1c20b19e5bd98ee0ab8bd5f8851b683a79c6 Mon Sep 17 00:00:00 2001 From: charlieablett Date: Fri, 14 Jun 2019 10:20:03 +1200 Subject: Remove N+1 query for project and group boards - Add test for N+1 queries - Add destroyable lists scope to Board and List - Preload lists for both project and group boards --- lib/api/entities.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/api/entities.rb') diff --git a/lib/api/entities.rb b/lib/api/entities.rb index ead01dc53f7..d783591c238 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -1101,7 +1101,7 @@ module API expose :project, using: Entities::BasicProjectDetails expose :lists, using: Entities::List do |board| - board.lists.destroyable + board.destroyable_lists end end -- cgit v1.2.1 From 7ecffe2987e0f3953489759d080fc263c5cb95c5 Mon Sep 17 00:00:00 2001 From: Jason Goodman Date: Wed, 3 Jul 2019 09:12:15 +0000 Subject: Show upcoming status for releases Add released_at field to releases API Add released_at column to releases table Return releases to the API sorted by released_at --- lib/api/entities.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/api/entities.rb') diff --git a/lib/api/entities.rb b/lib/api/entities.rb index d783591c238..b96903d4a8d 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -1186,8 +1186,10 @@ module API MarkupHelper.markdown_field(entity, :description) end expose :created_at + expose :released_at expose :author, using: Entities::UserBasic, if: -> (release, _) { release.author.present? } expose :commit, using: Entities::Commit, if: lambda { |_, _| can_download_code? } + expose :upcoming_release?, as: :upcoming_release expose :assets do expose :assets_count, as: :count do |release, _| -- cgit v1.2.1