diff --git a/app/presenters/comment_presenter.rb b/app/presenters/comment_presenter.rb index b665017a1..032c380fb 100644 --- a/app/presenters/comment_presenter.rb +++ b/app/presenters/comment_presenter.rb @@ -15,6 +15,7 @@ class CommentPresenter < ApplicationPresenter else issue = Issue.where(:id => comment.created_from_issue_id).first @referenced_issue = issue.pull_request || issue + @reference_project = issue.project if issue && (comment.data[:comment_id].nil? || Comment.exists?(comment.data[:comment_id])) title = if issue == opts[:commentable] "#{issue.serial_id}" @@ -111,8 +112,4 @@ class CommentPresenter < ApplicationPresenter pull_status_label @referenced_issue end.html_safe end - - def reference_project - @referenced_issue.project - end end diff --git a/app/presenters/git_presenters/commit_as_message_presenter.rb b/app/presenters/git_presenters/commit_as_message_presenter.rb index 988f324cd..a982e46c8 100644 --- a/app/presenters/git_presenters/commit_as_message_presenter.rb +++ b/app/presenters/git_presenters/commit_as_message_presenter.rb @@ -4,7 +4,7 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter attr_accessor :commit attr_reader :header, :image, :date, :caption, :content, :expandable, - :is_reference_to_issue, :committer, :reference_project + :is_reference_to_issue, :committer def initialize(commit, opts = {}) comment = opts[:comment] @@ -78,7 +78,7 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter end def reference_project - @project + @project if @is_reference_to_issue end protected