Merge pull request #296 from warpc/194-issue_page

[refs #194] fixed remove executor from issue
This commit is contained in:
Vladimir Sharshov 2012-03-14 04:18:29 -07:00
commit dc6e380647
3 changed files with 4 additions and 3 deletions

View File

@ -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,

View File

@ -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)

View File

@ -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