Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
549821a5
Commit
549821a5
authored
Jan 25, 2019
by
Brett Walker
Committed by
Fatih Acet
Jan 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add back call to execute_hooks
parent
ec66cf0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
20 deletions
+19
-20
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+18
-15
app/services/issuable_base_service.rb
app/services/issuable_base_service.rb
+1
-5
No files found.
app/models/concerns/issuable.rb
View file @
549821a5
...
@@ -270,26 +270,29 @@ module Issuable
...
@@ -270,26 +270,29 @@ module Issuable
def
to_hook_data
(
user
,
old_associations:
{})
def
to_hook_data
(
user
,
old_associations:
{})
changes
=
previous_changes
changes
=
previous_changes
old_labels
=
old_associations
.
fetch
(
:labels
,
[])
old_assignees
=
old_associations
.
fetch
(
:assignees
,
[])
if
old_
labels
!=
label
s
if
old_
association
s
changes
[
:labels
]
=
[
old_labels
.
map
(
&
:hook_attrs
),
labels
.
map
(
&
:hook_attrs
)]
old_labels
=
old_associations
.
fetch
(
:labels
,
[])
end
old_assignees
=
old_associations
.
fetch
(
:assignees
,
[])
if
old_assignees
!=
assignees
if
old_labels
!=
labels
if
self
.
is_a?
(
Issue
)
changes
[
:labels
]
=
[
old_labels
.
map
(
&
:hook_attrs
),
labels
.
map
(
&
:hook_attrs
)]
changes
[
:assignees
]
=
[
old_assignees
.
map
(
&
:hook_attrs
),
assignees
.
map
(
&
:hook_attrs
)]
else
changes
[
:assignee
]
=
[
old_assignees
&
.
first
&
.
hook_attrs
,
assignee
&
.
hook_attrs
]
end
end
end
if
self
.
respond_to?
(
:total_time_spent
)
if
old_assignees
!=
assignees
old_total_time_spent
=
old_associations
.
fetch
(
:total_time_spent
,
nil
)
if
self
.
is_a?
(
Issue
)
changes
[
:assignees
]
=
[
old_assignees
.
map
(
&
:hook_attrs
),
assignees
.
map
(
&
:hook_attrs
)]
else
changes
[
:assignee
]
=
[
old_assignees
&
.
first
&
.
hook_attrs
,
assignee
&
.
hook_attrs
]
end
end
if
self
.
respond_to?
(
:total_time_spent
)
old_total_time_spent
=
old_associations
.
fetch
(
:total_time_spent
,
nil
)
if
old_total_time_spent
!=
total_time_spent
if
old_total_time_spent
!=
total_time_spent
changes
[
:total_time_spent
]
=
[
old_total_time_spent
,
total_time_spent
]
changes
[
:total_time_spent
]
=
[
old_total_time_spent
,
total_time_spent
]
end
end
end
end
end
...
...
app/services/issuable_base_service.rb
View file @
549821a5
...
@@ -237,7 +237,6 @@ class IssuableBaseService < BaseService
...
@@ -237,7 +237,6 @@ class IssuableBaseService < BaseService
def
update_task
(
issuable
)
def
update_task
(
issuable
)
filter_params
(
issuable
)
filter_params
(
issuable
)
# old_associations = associations_before_update(issuable)
if
issuable
.
changed?
||
params
.
present?
if
issuable
.
changed?
||
params
.
present?
issuable
.
assign_attributes
(
params
.
merge
(
updated_by:
current_user
))
issuable
.
assign_attributes
(
params
.
merge
(
updated_by:
current_user
))
...
@@ -252,12 +251,9 @@ class IssuableBaseService < BaseService
...
@@ -252,12 +251,9 @@ class IssuableBaseService < BaseService
end
end
handle_task_changes
(
issuable
)
handle_task_changes
(
issuable
)
invalidate_cache_counts
(
issuable
,
users:
issuable
.
assignees
.
to_a
)
invalidate_cache_counts
(
issuable
,
users:
issuable
.
assignees
.
to_a
)
after_update
(
issuable
)
after_update
(
issuable
)
execute_hooks
(
issuable
,
'update'
,
old_associations:
nil
)
# execute_hooks(issuable, 'update', old_associations: old_associations)
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment