@@ -46,11 +46,4 class Document < ActiveRecord::Base | |||
|
46 | 46 | end |
|
47 | 47 | @updated_on |
|
48 | 48 | end |
|
49 | ||
|
50 | # Returns the mail adresses of users that should be notified | |
|
51 | def recipients | |
|
52 | notified = project.notified_users | |
|
53 | notified.reject! {|user| !visible?(user)} | |
|
54 | notified.collect(&:mail) | |
|
55 | end | |
|
56 | 49 | end |
@@ -90,13 +90,6 class Message < ActiveRecord::Base | |||
|
90 | 90 | usr && usr.logged? && (usr.allowed_to?(:delete_messages, project) || (self.author == usr && usr.allowed_to?(:delete_own_messages, project))) |
|
91 | 91 | end |
|
92 | 92 | |
|
93 | # Returns the mail adresses of users that should be notified | |
|
94 | def recipients | |
|
95 | notified = project.notified_users | |
|
96 | notified.reject! {|user| !visible?(user)} | |
|
97 | notified.collect(&:mail) | |
|
98 | end | |
|
99 | ||
|
100 | 93 | private |
|
101 | 94 | |
|
102 | 95 | def add_author_as_watcher |
@@ -33,13 +33,6 class News < ActiveRecord::Base | |||
|
33 | 33 | !user.nil? && user.allowed_to?(:view_news, project) |
|
34 | 34 | end |
|
35 | 35 | |
|
36 | # Returns the mail adresses of users that should be notified | |
|
37 | def recipients | |
|
38 | notified = project.notified_users | |
|
39 | notified.reject! {|user| !visible?(user)} | |
|
40 | notified.collect(&:mail) | |
|
41 | end | |
|
42 | ||
|
43 | 36 | # returns latest news for projects visible by user |
|
44 | 37 | def self.latest(user = User.current, count = 5) |
|
45 | 38 | find(:all, :limit => count, :conditions => Project.allowed_to_condition(user, :view_news), :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC") |
@@ -68,6 +68,13 module Redmine | |||
|
68 | 68 | (option.is_a?(Proc) ? option.call(self) : send(option)).merge(options) |
|
69 | 69 | end |
|
70 | 70 | |
|
71 | # Returns the mail adresses of users that should be notified | |
|
72 | def recipients | |
|
73 | notified = project.notified_users | |
|
74 | notified.reject! {|user| !visible?(user)} | |
|
75 | notified.collect(&:mail) | |
|
76 | end | |
|
77 | ||
|
71 | 78 | module ClassMethods |
|
72 | 79 | end |
|
73 | 80 | end |
General Comments 0
You need to be logged in to leave comments.
Login now