Code cleanup.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11958 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-06-11 18:18:02 +00:00
parent 3e9aeea75d
commit 2113b88db3
1 changed files with 1 additions and 1 deletions

View 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