diff --git a/app/models/activity_feed_observer.rb b/app/models/activity_feed_observer.rb index 0cc2c2737..95f3fe3d5 100644 --- a/app/models/activity_feed_observer.rb +++ b/app/models/activity_feed_observer.rb @@ -22,7 +22,7 @@ class ActivityFeedObserver < ActiveRecord::Observer ) end - if record.user_id_was != record.user_id + if record.user_id_changed? UserMailer.delay.issue_assign_notification(record, record.user) if record.user.notifier.issue_assign && record.user.notifier.can_notify ActivityFeed.create( :user => record.user, @@ -106,7 +106,7 @@ class ActivityFeedObserver < ActiveRecord::Observer def after_update(record) case record.class.to_s when 'Issue' - if record.user_id_was != record.user_id + if record.user_id && record.user_id_changed? UserMailer.delay.issue_assign_notification(record, record.user) if record.user.notifier.issue_assign && record.user.notifier.can_notify ActivityFeed.create( :user => record.user, diff --git a/app/models/issue.rb b/app/models/issue.rb index a3bd0f2e1..1a9ce3fad 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -80,7 +80,7 @@ class Issue < ActiveRecord::Base end def subscribe_issue_assigned_user - if self.user_id_was != self.user_id + if self.user_id && self.user_id_changed? self.subscribes.where(:user_id => self.user_id_was).first.destroy unless self.user_id_was.blank? if self.user.notifier.issue_assign && !self.subscribes.exists?(:user_id => self.user_id) self.subscribes.create(:user_id => self.user_id) diff --git a/app/views/issues/_manage_sidebar.html.haml b/app/views/issues/_manage_sidebar.html.haml index bd70ac04c..6cbb2cf42 100644 --- a/app/views/issues/_manage_sidebar.html.haml +++ b/app/views/issues/_manage_sidebar.html.haml @@ -14,6 +14,7 @@ - if @issue.persisted? -if can_manage =form_for :issue, :url => [@project, @issue], :method => :put, :html => { :class => 'edit_executor issue'} do |f| + =hidden_field_tag "user-default_executor", nil, :name => 'issue[user_id]' .current_executor - if @issue.user #user-0.people.nopointer