Add delegate for project's name on Note.
This commit is contained in:
parent
41c00a20a9
commit
2d124d9496
|
@ -24,28 +24,28 @@ class Notify < ActionMailer::Base
|
||||||
def note_wall_email(recipient_id, note_id)
|
def note_wall_email(recipient_id, note_id)
|
||||||
recipient = User.find(recipient_id)
|
recipient = User.find(recipient_id)
|
||||||
@note = Note.find(note_id)
|
@note = Note.find(note_id)
|
||||||
mail(:to => recipient.email, :subject => "gitlab | #{@note.project.name} ")
|
mail(:to => recipient.email, :subject => "gitlab | #{@note.project_name} ")
|
||||||
end
|
end
|
||||||
|
|
||||||
def note_commit_email(recipient_id, note_id)
|
def note_commit_email(recipient_id, note_id)
|
||||||
recipient = User.find(recipient_id)
|
recipient = User.find(recipient_id)
|
||||||
@note = Note.find(note_id)
|
@note = Note.find(note_id)
|
||||||
@commit = @note.target
|
@commit = @note.target
|
||||||
mail(:to => recipient.email, :subject => "gitlab | note for commit | #{@note.project.name} ")
|
mail(:to => recipient.email, :subject => "gitlab | note for commit | #{@note.project_name} ")
|
||||||
end
|
end
|
||||||
|
|
||||||
def note_merge_request_email(recipient_id, note_id)
|
def note_merge_request_email(recipient_id, note_id)
|
||||||
recipient = User.find(recipient_id)
|
recipient = User.find(recipient_id)
|
||||||
@note = Note.find(note_id)
|
@note = Note.find(note_id)
|
||||||
@merge_request = @note.noteable
|
@merge_request = @note.noteable
|
||||||
mail(:to => recipient.email, :subject => "gitlab | note for merge request | #{@note.project.name} ")
|
mail(:to => recipient.email, :subject => "gitlab | note for merge request | #{@note.project_name} ")
|
||||||
end
|
end
|
||||||
|
|
||||||
def note_issue_email(recipient_id, note_id)
|
def note_issue_email(recipient_id, note_id)
|
||||||
recipient = User.find(recipient_id)
|
recipient = User.find(recipient_id)
|
||||||
@note = Note.find(note_id)
|
@note = Note.find(note_id)
|
||||||
@issue = @note.noteable
|
@issue = @note.noteable
|
||||||
mail(:to => recipient.email, :subject => "gitlab | note for issue #{@issue.id} | #{@note.project.name} ")
|
mail(:to => recipient.email, :subject => "gitlab | note for issue #{@issue.id} | #{@note.project_name} ")
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_merge_request_email(merge_request)
|
def new_merge_request_email(merge_request)
|
||||||
|
|
|
@ -7,6 +7,10 @@ class Note < ActiveRecord::Base
|
||||||
belongs_to :author,
|
belongs_to :author,
|
||||||
:class_name => "User"
|
:class_name => "User"
|
||||||
|
|
||||||
|
delegate :name,
|
||||||
|
:to => :project,
|
||||||
|
:prefix => true
|
||||||
|
|
||||||
delegate :name,
|
delegate :name,
|
||||||
:email,
|
:email,
|
||||||
:to => :author,
|
:to => :author,
|
||||||
|
|
Loading…
Reference in a new issue