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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
f008cdf2
Commit
f008cdf2
authored
Oct 13, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Issuable#add_labels_by_names
parent
ed7591f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
38 deletions
+18
-38
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+0
-12
lib/gitlab/fogbugz_import/importer.rb
lib/gitlab/fogbugz_import/importer.rb
+10
-15
lib/gitlab/google_code_import/importer.rb
lib/gitlab/google_code_import/importer.rb
+8
-11
No files found.
app/models/concerns/issuable.rb
View file @
f008cdf2
...
@@ -230,18 +230,6 @@ module Issuable
...
@@ -230,18 +230,6 @@ module Issuable
labels
.
order
(
'title ASC'
).
pluck
(
:title
)
labels
.
order
(
'title ASC'
).
pluck
(
:title
)
end
end
def
add_labels_by_names
(
label_names
,
current_user
)
available_labels
=
LabelsFinder
.
new
(
current_user
,
project_id:
project
.
id
).
execute
label_names
.
each
do
|
label_name
|
title
=
label_name
.
strip
label
=
available_labels
.
find_by
(
title:
title
)
label
||=
project
.
labels
.
build
(
title:
title
,
color:
Label
::
DEFAULT_COLOR
)
self
.
labels
<<
label
end
end
# Convert this Issuable class name to a format usable by Ability definitions
# Convert this Issuable class name to a format usable by Ability definitions
#
#
# Examples:
# Examples:
...
...
lib/gitlab/fogbugz_import/importer.rb
View file @
f008cdf2
...
@@ -122,25 +122,20 @@ module Gitlab
...
@@ -122,25 +122,20 @@ module Gitlab
author_id
=
user_info
(
bug
[
'ixPersonOpenedBy'
])[
:gitlab_id
]
||
project
.
creator_id
author_id
=
user_info
(
bug
[
'ixPersonOpenedBy'
])[
:gitlab_id
]
||
project
.
creator_id
issue
=
Issue
.
create!
(
issue
=
Issue
.
create!
(
project_id:
project
.
id
,
iid:
bug
[
'ixBug'
],
title:
bug
[
'sTitle'
],
project_id:
project
.
id
,
description:
body
,
title:
bug
[
'sTitle'
],
author_id:
author_id
,
description:
body
,
assignee_id:
assignee_id
,
author_id:
author_id
,
state:
bug
[
'fOpen'
]
==
'true'
?
'opened'
:
'closed'
assignee_id:
assignee_id
,
state:
bug
[
'fOpen'
]
==
'true'
?
'opened'
:
'closed'
,
created_at:
date
,
updated_at:
DateTime
.
parse
(
bug
[
'dtLastUpdated'
])
)
)
issue
.
add_labels_by_names
(
labels
,
project
.
creator
)
if
issue
.
iid
!=
bug
[
'ixBug'
]
issue
.
update_attribute
(
:label_ids
,
project
.
labels
.
where
(
title:
labels
).
pluck
(
:id
))
issue
.
update_attribute
(
:iid
,
bug
[
'ixBug'
])
end
import_issue_comments
(
issue
,
comments
)
import_issue_comments
(
issue
,
comments
)
issue
.
update_attribute
(
:created_at
,
date
)
last_update
=
DateTime
.
parse
(
bug
[
'dtLastUpdated'
])
issue
.
update_attribute
(
:updated_at
,
last_update
)
end
end
end
end
...
...
lib/gitlab/google_code_import/importer.rb
View file @
f008cdf2
...
@@ -92,19 +92,16 @@ module Gitlab
...
@@ -92,19 +92,16 @@ module Gitlab
end
end
issue
=
Issue
.
create!
(
issue
=
Issue
.
create!
(
project_id:
project
.
id
,
iid:
raw_issue
[
'id'
],
title:
raw_issue
[
"title"
],
project_id:
project
.
id
,
description:
body
,
title:
raw_issue
[
'title'
],
author_id:
project
.
creator_id
,
description:
body
,
assignee_id:
assignee_id
,
author_id:
project
.
creator_id
,
state:
raw_issue
[
"state"
]
==
"closed"
?
"closed"
:
"opened"
assignee_id:
assignee_id
,
state:
raw_issue
[
'state'
]
==
'closed'
?
'closed'
:
'opened'
)
)
issue
.
add_labels_by_names
(
labels
,
project
.
creator
)
issue
.
update_attribute
(
:label_ids
,
project
.
labels
.
where
(
title:
labels
).
pluck
(
:id
))
if
issue
.
iid
!=
raw_issue
[
"id"
]
issue
.
update_attribute
(
:iid
,
raw_issue
[
"id"
])
end
import_issue_comments
(
issue
,
comments
)
import_issue_comments
(
issue
,
comments
)
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