OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
hide embedded completely if empty
ulfertsb08d4ed57362
diff --git a/lib/api/decorators/sql/hal.rb b/lib/api/decorators/sql/hal.rbindex 185f1868b42..0836121588b 100644--- a/lib/api/decorators/sql/hal.rb+++ b/lib/api/decorators/sql/hal.rb@@ -154,10 +154,13 @@ module APIlink[:column]end+ next unless representation+<<-SQL.squish'#{name}', #{representation}SQLend+ .flatten.join(', ')enddiff --git a/lib/api/decorators/sql_collection_representer.rb b/lib/api/decorators/sql_collection_representer.rbindex ce837305cda..87dc6cf944f 100644--- a/lib/api/decorators/sql_collection_representer.rb+++ b/lib/api/decorators/sql_collection_representer.rb@@ -123,7 +123,7 @@ module APIrepresentation: ->(walker_result) doreplacement = walker_result.replace_map['elements']- replacement ? "json_agg(#{replacement})" : 'null'+ replacement ? "json_agg(#{replacement})" : nilendendenddiff --git a/spec/lib/api/v3/projects/project_sql_collection_representer_rendering_spec.rb b/spec/lib/api/v3/projects/project_sql_collection_representer_rendering_spec.rbindex 4fa365fe99b..6ba3a8ae5f5 100644--- a/spec/lib/api/v3/projects/project_sql_collection_representer_rendering_spec.rb+++ b/spec/lib/api/v3/projects/project_sql_collection_representer_rendering_spec.rb@@ -118,8 +118,6 @@ describe ::API::V3::Projects::ProjectSqlCollectionRepresenter, 'rendering' dototal: 1,count: 1,offset: 1,- # TODO: remove empty embedded- _embedded: {},_links: {self: {href: "some_path?offset=1&pageSize=5&select=%2A"