From 33e4654abf2e185e3038155cd974031896efec05 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Tue, 29 Aug 2017 19:36:56 +0200 Subject: [PATCH 2/3] Cleanup: Remove Issue#each_notification and Journal#each_notification These methods are not needed anymore since we are sending one mail per recipient in all cases. --- app/models/issue.rb | 15 --------------- app/models/journal.rb | 13 ------------- 2 files changed, 28 deletions(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index 5798fef9f..2f40e8726 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1042,21 +1042,6 @@ class Issue < ActiveRecord::Base notified_users.collect(&:mail) end - def each_notification(users, &block) - if users.any? - if custom_field_values.detect {|value| !value.custom_field.visible?} - users_by_custom_field_visibility = users.group_by do |user| - visible_custom_field_values(user).map(&:custom_field_id).sort - end - users_by_custom_field_visibility.values.each do |users| - yield(users) - end - else - yield(users) - end - end - end - def notify? @notify != false end diff --git a/app/models/journal.rb b/app/models/journal.rb index 77823d0c2..cc96967f5 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -94,19 +94,6 @@ class Journal < ActiveRecord::Base end end - def each_notification(users, &block) - if users.any? - users_by_details_visibility = users.group_by do |user| - visible_details(user) - end - users_by_details_visibility.each do |visible_details, users| - if notes? || visible_details.any? - yield(users) - end - end - end - end - # Returns the JournalDetail for the given attribute, or nil if the attribute # was not updated def detail_for_attribute(attribute) -- 2.13.0