Commit 31775ad8 authored by Wei-Meng Lee's avatar Wei-Meng Lee

Move group_notification_email outside conditional

parent 11fb4d42
...@@ -79,10 +79,9 @@ class Notify < BaseMailer ...@@ -79,10 +79,9 @@ class Notify < BaseMailer
# Returns a String containing the User's email address. # Returns a String containing the User's email address.
def recipient(recipient_id, notification_group = nil) def recipient(recipient_id, notification_group = nil)
@current_user = User.find(recipient_id) @current_user = User.find(recipient_id)
group_notification_email = nil
if notification_group if notification_group
group_notification_email = nil
# Get notification group's and ancestors' notification settings # Get notification group's and ancestors' notification settings
group_ids = notification_group.self_and_ancestors_ids group_ids = notification_group.self_and_ancestors_ids
notification_settings = notification_group.notification_settings.where(user: @current_user) # rubocop: disable CodeReuse/ActiveRecord notification_settings = notification_group.notification_settings.where(user: @current_user) # rubocop: disable CodeReuse/ActiveRecord
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment