From 9b97f7e472a4e0a1d7f1d65ccd4fce31cf0e2221 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 22 Jul 2016 17:58:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=94=A8=E6=88=B7=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5=E5=85=B3=E6=B3=A8=E5=92=8C=E7=B2=89=E4=B8=9D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb index a26980c40..06d661478 100644 --- a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb +++ b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb @@ -10,11 +10,7 @@ module Redmine def acts_as_watchable(options = {}) return if self.included_modules.include?(Redmine::Acts::Watchable::InstanceMethods) class_eval do - if self.name == 'User' - has_many :watchers, :dependent => :delete_all - else - has_many :watchers, :as => :watchable, :dependent => :delete_all - end + has_many :watchers, :as => :watchable, :dependent => :delete_all has_many :watcher_users, :through => :watchers, :source => :user, :validate => false scope :watched_by, lambda { |user_id|