diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-06-11 18:25:05 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-06-11 18:25:05 +0000 |
commit | e0c7eb25a42e6b052c90b32014ef7dc96560f47f (patch) | |
tree | ff59fc0416667bed244d00569ebb48390a2dfceb /app/helpers/watchers_helper.rb | |
parent | 2113b88db34bef9ef4af18e766f2a882505ee789 (diff) | |
download | redmine-e0c7eb25a42e6b052c90b32014ef7dc96560f47f.tar.gz redmine-e0c7eb25a42e6b052c90b32014ef7dc96560f47f.zip |
Adds Watcher.any_watched? to check if at least one object of a collection is watched.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11959 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/watchers_helper.rb')
-rw-r--r-- | app/helpers/watchers_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index b69837c2a..0d3951203 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -28,7 +28,7 @@ module WatchersHelper return '' unless user && user.logged? objects = Array.wrap(objects) - watched = objects.any? {|object| object.watched_by?(user)} + watched = Watcher.any_watched?(objects, user) css = [watcher_css(objects), watched ? 'icon icon-fav' : 'icon icon-fav-off'].join(' ') text = watched ? l(:button_unwatch) : l(:button_watch) url = watch_path( |