diff options
Diffstat (limited to 'vendor/plugins')
-rw-r--r-- | vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb b/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb index c13da4fd4..f99f4a60d 100644 --- a/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb +++ b/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb @@ -15,6 +15,10 @@ module Redmine has_many :watchers, :as => :watchable, :dependent => :delete_all has_many :watcher_users, :through => :watchers, :source => :user + named_scope :watched_by, lambda { |user_id| + { :include => :watchers, + :conditions => ["#{Watcher.table_name}.user_id = ?", user_id] } + } attr_protected :watcher_ids, :watcher_user_ids end end @@ -60,14 +64,7 @@ module Redmine notified.collect(&:mail).compact end - module ClassMethods - # Returns the objects that are watched by user - def watched_by(user) - find(:all, - :include => :watchers, - :conditions => ["#{Watcher.table_name}.user_id = ?", user.id]) - end - end + module ClassMethods; end end end end |