Fetch locals to avoid undefined method/local error

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034/diffs#note_17868074
This commit is contained in:
Lin Jen-Shin 2016-11-04 22:43:43 +08:00
parent b9b508ad05
commit 99410a4750
3 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -1,3 +1,4 @@
- ref = local_assigns.fetch(:ref)
- if @note_counts
- note_count = @note_counts.fetch(commit.id, 0)
- else

View File

@ -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|