diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-03-27 14:58:23 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-02 23:36:54 +0300 |
commit | c5d7660000be72dd03ac52641debbd2bcf6fbc4d (patch) | |
tree | 024c8a78bea0b70cabbbdd3b17e19c4892e4d932 /app/mailers/notify.rb | |
parent | 8361ba81abbab2d28ae5018daf531992710dc4ca (diff) |
Fix errors.
Diffstat (limited to 'app/mailers/notify.rb')
-rw-r--r-- | app/mailers/notify.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 8fcdd3bc853..5dbbfac9c8b 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -13,6 +13,9 @@ class Notify < ActionMailer::Base add_template_helper MergeRequestsHelper add_template_helper EmailsHelper + attr_accessor :current_user + helper_method :current_user, :can? + default_url_options[:host] = Gitlab.config.gitlab.host default_url_options[:protocol] = Gitlab.config.gitlab.protocol default_url_options[:port] = Gitlab.config.gitlab.port unless Gitlab.config.gitlab_on_standard_port? @@ -79,9 +82,8 @@ class Notify < ActionMailer::Base # # Returns a String containing the User's email address. def recipient(recipient_id) - if recipient = User.find(recipient_id) - recipient.notification_email - end + @current_user = User.find(recipient_id) + @current_user.notification_email end # Set the References header field @@ -154,4 +156,8 @@ class Notify < ActionMailer::Base mail(headers, &block) end + + def can? + Ability.abilities.allowed?(user, action, subject) + end end |