diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-14 18:08:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-14 18:08:14 +0300 |
commit | 87f286558de1f5790b0b1742f10548387b5d147a (patch) | |
tree | c483d5f3542094d2123c8116ffee22430d9ad9c9 /app/services/resource_events | |
parent | 674e7e2c3d295704bdf504dd0caa2e5a2d9b5cd2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/resource_events')
-rw-r--r-- | app/services/resource_events/change_milestone_service.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/services/resource_events/change_milestone_service.rb b/app/services/resource_events/change_milestone_service.rb index ea196822f74..f09c2e1d735 100644 --- a/app/services/resource_events/change_milestone_service.rb +++ b/app/services/resource_events/change_milestone_service.rb @@ -2,13 +2,14 @@ module ResourceEvents class ChangeMilestoneService - attr_reader :resource, :user, :event_created_at, :milestone + attr_reader :resource, :user, :event_created_at, :milestone, :old_milestone - def initialize(resource, user, created_at: Time.now) + def initialize(resource, user, created_at: Time.now, old_milestone:) @resource = resource @user = user @event_created_at = created_at @milestone = resource&.milestone + @old_milestone = old_milestone end def execute @@ -26,7 +27,7 @@ module ResourceEvents { user_id: user.id, created_at: event_created_at, - milestone_id: milestone&.id, + milestone_id: action == :add ? milestone&.id : old_milestone&.id, state: ResourceMilestoneEvent.states[resource.state], action: ResourceMilestoneEvent.actions[action], key => resource.id |