summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/mailers/notify.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index 9d2deb35cd4..3683f2ea9a9 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -195,12 +195,16 @@ class Notify < BaseMailer
@reply_key ||= SentNotification.reply_key
end
- def add_model_headers(model)
+ # This method applies threading headers to the email to identify
+ # the instance we are discussing.
+ #
+ # All model instances must have `#id`, and may implement `#iid`.
+ def add_model_headers(object)
# Use replacement so we don't strip the module.
- prefix = "X-GitLab-#{model.class.name.gsub(/::/, '-')}"
+ prefix = "X-GitLab-#{object.class.name.gsub(/::/, '-')}"
- headers["#{prefix}-ID"] = model.id if model.respond_to?(:id)
- headers["#{prefix}-IID"] = model.iid if model.respond_to?(:iid)
+ headers["#{prefix}-ID"] = object.id
+ headers["#{prefix}-IID"] = object.iid if object.respond_to?(:iid)
end
def add_project_headers