]> source.dussan.org Git - redmine.git/commitdiff
Code cleanup.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 11 Jun 2013 18:18:02 +0000 (18:18 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 11 Jun 2013 18:18:02 +0000 (18:18 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11958 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb

index c284af38dd1fb8c31aab8f650e00e8115ba4cb5a..4ce3bb4a1d07e0da3e824fba80cf2926751d661f 100644 (file)
@@ -46,7 +46,7 @@ module Redmine
         # Removes user from the watchers list
         def remove_watcher(user)
           return nil unless user && user.is_a?(User)
-          Watcher.delete_all "watchable_type = '#{self.class}' AND watchable_id = #{self.id} AND user_id = #{user.id}"
+          watchers.where(:user_id => user.id).delete_all
         end
 
         # Adds/removes watcher