From 99410a4750b514b8d58a6d44f687ef29ecebc7cc Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Fri, 4 Nov 2016 22:43:43 +0800 Subject: [PATCH] Fetch locals to avoid undefined method/local error Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034/diffs#note_17868074 --- app/views/projects/_last_commit.html.haml | 1 + app/views/projects/commits/_commit.html.haml | 1 + app/views/projects/commits/_commits.html.haml | 1 + 3 files changed, 3 insertions(+) diff --git a/app/views/projects/_last_commit.html.haml b/app/views/projects/_last_commit.html.haml index 8aa503159f9..8e23d51b224 100644 --- a/app/views/projects/_last_commit.html.haml +++ b/app/views/projects/_last_commit.html.haml @@ -1,3 +1,4 @@ +- ref = local_assigns.fetch(:ref) - status = commit.status(ref) - if status = link_to builds_namespace_project_commit_path(commit.project.namespace, commit.project, commit), class: "ci-status ci-#{status}" do diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index fd70de9c13d..9f80a974d64 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -1,3 +1,4 @@ +- ref = local_assigns.fetch(:ref) - if @note_counts - note_count = @note_counts.fetch(commit.id, 0) - else diff --git a/app/views/projects/commits/_commits.html.haml b/app/views/projects/commits/_commits.html.haml index 943ec24cfb5..48756c68941 100644 --- a/app/views/projects/commits/_commits.html.haml +++ b/app/views/projects/commits/_commits.html.haml @@ -1,3 +1,4 @@ +- ref = local_assigns.fetch(:ref) - commits, hidden = limited_commits(@commits) - commits.chunk { |c| c.committed_date.in_time_zone.to_date }.each do |day, commits|