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
a0e65049
Commit
a0e65049
authored
Mar 20, 2020
by
Patrick Derichs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore obsolete columns for resource_milestone_events
parent
08eec0c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
app/models/resource_milestone_event.rb
app/models/resource_milestone_event.rb
+4
-0
app/services/issuable/clone/attributes_rewriter.rb
app/services/issuable/clone/attributes_rewriter.rb
+1
-1
spec/services/issuable/clone/attributes_rewriter_spec.rb
spec/services/issuable/clone/attributes_rewriter_spec.rb
+0
-3
No files found.
app/models/resource_milestone_event.rb
View file @
a0e65049
# frozen_string_literal: true
# frozen_string_literal: true
class
ResourceMilestoneEvent
<
ResourceEvent
class
ResourceMilestoneEvent
<
ResourceEvent
include
IgnorableColumns
belongs_to
:issue
belongs_to
:issue
belongs_to
:merge_request
belongs_to
:merge_request
belongs_to
:milestone
belongs_to
:milestone
...
@@ -18,6 +20,8 @@ class ResourceMilestoneEvent < ResourceEvent
...
@@ -18,6 +20,8 @@ class ResourceMilestoneEvent < ResourceEvent
# state is used for issue and merge request states.
# state is used for issue and merge request states.
enum
state:
Issue
.
available_states
.
merge
(
MergeRequest
.
available_states
)
enum
state:
Issue
.
available_states
.
merge
(
MergeRequest
.
available_states
)
ignore_columns
%i[reference reference_html cached_markdown_version]
,
remove_with:
'13.1'
,
remove_after:
'2020-06-22'
def
self
.
issuable_attrs
def
self
.
issuable_attrs
%i(issue merge_request)
.
freeze
%i(issue merge_request)
.
freeze
end
end
...
...
app/services/issuable/clone/attributes_rewriter.rb
View file @
a0e65049
...
@@ -74,7 +74,7 @@ module Issuable
...
@@ -74,7 +74,7 @@ module Issuable
if
matching_destination_milestone
.
present?
if
matching_destination_milestone
.
present?
event
.
attributes
event
.
attributes
.
except
(
'id'
,
'reference'
,
'reference_html'
)
.
except
(
'id'
)
.
merge
(
entity_key
=>
new_entity
.
id
,
.
merge
(
entity_key
=>
new_entity
.
id
,
'milestone_id'
=>
matching_destination_milestone
.
id
,
'milestone_id'
=>
matching_destination_milestone
.
id
,
'action'
=>
ResourceMilestoneEvent
.
actions
[
event
.
action
],
'action'
=>
ResourceMilestoneEvent
.
actions
[
event
.
action
],
...
...
spec/services/issuable/clone/attributes_rewriter_spec.rb
View file @
a0e65049
...
@@ -112,9 +112,6 @@ describe Issuable::Clone::AttributesRewriter do
...
@@ -112,9 +112,6 @@ describe Issuable::Clone::AttributesRewriter do
expect
(
event
.
milestone_id
).
to
eq
(
expected_attrs
[
:milestone
].
id
)
expect
(
event
.
milestone_id
).
to
eq
(
expected_attrs
[
:milestone
].
id
)
expect
(
event
.
action
).
to
eq
(
expected_attrs
[
:action
])
expect
(
event
.
action
).
to
eq
(
expected_attrs
[
:action
])
expect
(
event
.
state
).
to
eq
(
expected_attrs
[
:state
])
expect
(
event
.
state
).
to
eq
(
expected_attrs
[
:state
])
expect
(
event
.
reference
).
to
be_nil
expect
(
event
.
reference_html
).
to
be_nil
end
end
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