From 9b97f7e472a4e0a1d7f1d65ccd4fce31cf0e2221 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 22 Jul 2016 17:58:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E5=85=B3=E6=B3=A8=E5=92=8C=E7=B2=89=E4=B8=9D?= =?UTF-8?q?=E9=97=AE=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| From ab4d85dcb7b12f87d14f3877f152bb18150e0888 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 22 Jul 2016 18:21:27 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BB=84=E7=BB=87500=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_activities.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb index 4a74a5f81..87c976d0f 100644 --- a/app/views/organizations/_org_activities.html.erb +++ b/app/views/organizations/_org_activities.html.erb @@ -46,7 +46,7 @@ <% end %> - <% if act.org_act && act.org_act_type == 'OrgDocumentComment' && act.org_act.organization.home_id != act.org_act.id %> + <% if act.org_act_type == 'OrgDocumentComment' && act.org_act && act.org_act.organization.home_id != act.org_act.id %> <%= render :partial => 'show_org_document', :locals => {:document => act.org_act, :act => act, :flag => 2, :org_subfield_id => params[:org_subfield_id]} %> <% end %> <% end %>