diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-04-30 11:02:27 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-04-30 11:02:27 +0000 |
commit | a00d1eabd7c47ad93cbcffc7eb6d6b7ed7f0f3f0 (patch) | |
tree | cf22301545900d3e9a5ca1605b03e7ec44256e3a /vendor | |
parent | e5180884c1e51e5751e7c7a7b1b44a5c25b934b7 (diff) | |
download | redmine-a00d1eabd7c47ad93cbcffc7eb6d6b7ed7f0f3f0.tar.gz redmine-a00d1eabd7c47ad93cbcffc7eb6d6b7ed7f0f3f0.zip |
Fixed: watchers selection lost when issue creation fails (#5406). #watched_by? was fixed in order to work with #watcher_user_ids= used in controllers on unsaved objects.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3705 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb | 4 |
1 files changed, 2 insertions, 2 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 f99f4a60d..b4ac776ec 100644 --- a/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb +++ b/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb @@ -50,9 +50,9 @@ module Redmine watching ? add_watcher(user) : remove_watcher(user) end - # Returns true if object is watched by user + # Returns true if object is watched by +user+ def watched_by?(user) - !!(user && self.watchers.detect {|w| w.user_id == user.id }) + !!(user && self.watcher_user_ids.detect {|uid| uid == user.id }) end # Returns an array of watchers' email addresses |