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
Also make the title attribute configurable in the factory
Klaus Zandersc82ce4040fb0
diff --git a/lib/api/v3/shares/entity_representer_factory.rb b/lib/api/v3/shares/entity_representer_factory.rbindex 0a9f9ba8ae7..8a669833215 100644--- a/lib/api/v3/shares/entity_representer_factory.rb+++ b/lib/api/v3/shares/entity_representer_factory.rb@@ -36,8 +36,7 @@ module API# Create the appropriate subclass representer# for each principal entitydef create(model, **args)- representer_class(model)- .create(model, **args)+ representer_class(model).create(model, **args)enddef representer_class(model)@@ -57,14 +56,23 @@ module APIendend+ def title_attribute(model)+ case model+ when WorkPackage then :subject+ else+ raise ArgumentError, "Missing concrete entity representer for #{model}"+ end+ end+def create_link_lambda(name, getter: "#{name}_id")->(*) {v3_path = API::V3::Shares::EntityRepresenterFactory.representer_type(represented.send(name))+ title_attribute = API::V3::Shares::EntityRepresenterFactory.title_attribute(represented.send(name))instance_exec(&self.class.associated_resource_default_link(name,v3_path:,skip_link: -> { false },- title_attribute: :subject,+ title_attribute:,getter:))}end