Skip to content

Commit 9cd5315

Browse files
committed
Memoize goal_text in SprintComponent
Avoids repeated `goal_text_for` lookups when the goals association is not preloaded.
1 parent de69496 commit 9cd5315

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

modules/backlogs/app/components/backlogs/sprint_component.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ def finish_sprint_button_arguments
9292
end
9393

9494
def goal_text
95-
sprint.goal_text_for(project)
95+
return @goal_text if defined?(@goal_text)
96+
97+
@goal_text = sprint.goal_text_for(project)
9698
end
9799

98100
def sprint_goal_id

0 commit comments

Comments
 (0)