Revision 442:753f1380d6bc vendor/plugins/acts_as_watchable/lib

View differences:

vendor/plugins/acts_as_watchable/lib/.svn/entries
1 1
10
2 2

  
3 3
dir
4
4993
5
http://redmine.rubyforge.org/svn/trunk/vendor/plugins/acts_as_watchable/lib
4
6000
5
http://redmine.rubyforge.org/svn/branches/1.2-stable/vendor/plugins/acts_as_watchable/lib
6 6
http://redmine.rubyforge.org/svn
7 7

  
8 8

  
9 9

  
10
2010-06-20T18:41:30.111362Z
11
3803
12
edavis10
10
2011-05-29T07:18:05.033755Z
11
5945
12
jplang
13 13

  
14 14

  
15 15

  
......
32 32

  
33 33

  
34 34

  
35
2011-03-03T11:05:12.000000Z
36
30f73616865f02dadce09f9511269b70
37
2010-06-20T18:41:30.111362Z
38
3803
39
edavis10
35
2011-06-06T13:18:33.000000Z
36
3b3a89183c72eb8f1ef981156b502ca9
37
2011-05-29T07:18:05.033755Z
38
5945
39
jplang
40 40
has-props
41 41

  
42 42

  
......
58 58

  
59 59

  
60 60

  
61
2265
61
2489
62 62

vendor/plugins/acts_as_watchable/lib/.svn/text-base/acts_as_watchable.rb.svn-base
13 13
          
14 14
          class_eval do
15 15
            has_many :watchers, :as => :watchable, :dependent => :delete_all
16
            has_many :watcher_users, :through => :watchers, :source => :user
16
            has_many :watcher_users, :through => :watchers, :source => :user, :validate => false
17 17
            
18 18
            named_scope :watched_by, lambda { |user_id|
19 19
              { :include => :watchers,
......
31 31
        
32 32
        # Returns an array of users that are proposed as watchers
33 33
        def addable_watcher_users
34
          self.project.users.sort - self.watcher_users
34
          users = self.project.users.sort - self.watcher_users
35
          if respond_to?(:visible?)
36
            users.reject! {|user| !visible?(user)}
37
          end
38
          users
35 39
        end
36 40
        
37 41
        # Adds user as a watcher
......
58 62
        # Returns an array of watchers' email addresses
59 63
        def watcher_recipients
60 64
          notified = watcher_users.active
61

  
65
          notified.reject! {|user| user.mail_notification == 'none'}
66
          
62 67
          if respond_to?(:visible?)
63 68
            notified.reject! {|user| !visible?(user)}
64 69
          end
vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb
13 13
          
14 14
          class_eval do
15 15
            has_many :watchers, :as => :watchable, :dependent => :delete_all
16
            has_many :watcher_users, :through => :watchers, :source => :user
16
            has_many :watcher_users, :through => :watchers, :source => :user, :validate => false
17 17
            
18 18
            named_scope :watched_by, lambda { |user_id|
19 19
              { :include => :watchers,
......
31 31
        
32 32
        # Returns an array of users that are proposed as watchers
33 33
        def addable_watcher_users
34
          self.project.users.sort - self.watcher_users
34
          users = self.project.users.sort - self.watcher_users
35
          if respond_to?(:visible?)
36
            users.reject! {|user| !visible?(user)}
37
          end
38
          users
35 39
        end
36 40
        
37 41
        # Adds user as a watcher
......
58 62
        # Returns an array of watchers' email addresses
59 63
        def watcher_recipients
60 64
          notified = watcher_users.active
61

  
65
          notified.reject! {|user| user.mail_notification == 'none'}
66
          
62 67
          if respond_to?(:visible?)
63 68
            notified.reject! {|user| !visible?(user)}
64 69
          end

Also available in: Unified diff