code format cleanup Watcher model
git-svn-id: http://svn.redmine.org/redmine/trunk@12568 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
8a9db2841d
commit
05aa146fad
|
@ -62,11 +62,12 @@ class Watcher < ActiveRecord::Base
|
||||||
pruned = 0
|
pruned = 0
|
||||||
where(:user_id => user.id).all.each do |watcher|
|
where(:user_id => user.id).all.each do |watcher|
|
||||||
next if watcher.watchable.nil?
|
next if watcher.watchable.nil?
|
||||||
|
|
||||||
if options.has_key?(:project)
|
if options.has_key?(:project)
|
||||||
next unless watcher.watchable.respond_to?(:project) && watcher.watchable.project == options[:project]
|
unless watcher.watchable.respond_to?(:project) &&
|
||||||
|
watcher.watchable.project == options[:project]
|
||||||
|
next
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if watcher.watchable.respond_to?(:visible?)
|
if watcher.watchable.respond_to?(:visible?)
|
||||||
unless watcher.watchable.visible?(user)
|
unless watcher.watchable.visible?(user)
|
||||||
watcher.destroy
|
watcher.destroy
|
||||||
|
|
Loading…
Reference in New Issue