Skip to content

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

Apply suggestions from code review

Oliver Güntherabc7b48fac26
diff --git a/app/components/projects/row_component.rb b/app/components/projects/row_component.rb
index ee236f8ad7b..5f598cd13f4 100644
--- a/app/components/projects/row_component.rb
+++ b/app/components/projects/row_component.rb
@@ -29,7 +29,7 @@
#++
module Projects
class RowComponent < ::RowComponent
- delegate :favored_projects, to: :table
+ delegate :favored_project_ids, to: :table
def project
model.first
@@ -45,7 +45,7 @@ module Projects
end
def favored
- if favored_projects.include?(project.id)
+ if favored_project_ids.include?(project.id)
render(Primer::Beta::Octicon.new(icon: "star-fill", classes: "op-primer--star-icon", "aria-label": I18n.t(:label_favoured)))
end
end
diff --git a/app/components/projects/table_component.rb b/app/components/projects/table_component.rb
index 151a344e759..048288c7e55 100644
--- a/app/components/projects/table_component.rb
+++ b/app/components/projects/table_component.rb
@@ -153,7 +153,7 @@ module Projects
end
end
- def favored_projects
+ def favored_project_ids
@favored_projects ||= Favorite.where(user: current_user, favored_type: 'Project').pluck(:favored_id)
end