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

memoize instead of just assigning instance variables

Ivan Kuchin048906a001ad
diff --git a/app/menus/projects/menu.rb b/app/menus/projects/menu.rb
index 9a8b1825dfe..e7cc468af97 100644
--- a/app/menus/projects/menu.rb
+++ b/app/menus/projects/menu.rb
@@ -120,14 +120,14 @@ module Projects
end
def persisted_filters
- @persisted_filters = ::ProjectQuery
+ @persisted_filters ||= ::ProjectQuery
.visible(current_user)
.with_favored_by_user(current_user)
.order(favored: :desc, name: :asc)
end
def favored_ids
- @favored_ids = persisted_filters.select(&:favored).to_set(&:id)
+ @favored_ids ||= persisted_filters.select(&:favored).to_set(&:id)
end
def modification_params?