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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
a5b255fb
Commit
a5b255fb
authored
Jan 22, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code improvements according to styleguide
parent
635f62be
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+6
-2
app/models/note.rb
app/models/note.rb
+5
-2
No files found.
app/models/concerns/issuable.rb
View file @
a5b255fb
...
@@ -124,10 +124,12 @@ module Issuable
...
@@ -124,10 +124,12 @@ module Issuable
users
<<
assignee
if
is_assigned?
users
<<
assignee
if
is_assigned?
mentions
=
[]
mentions
=
[]
mentions
<<
self
.
mentioned_users
mentions
<<
self
.
mentioned_users
notes
.
each
do
|
note
|
notes
.
each
do
|
note
|
users
<<
note
.
author
users
<<
note
.
author
mentions
<<
note
.
mentioned_users
mentions
<<
note
.
mentioned_users
end
end
users
.
concat
(
mentions
.
reduce
([],
:|
)).
uniq
users
.
concat
(
mentions
.
reduce
([],
:|
)).
uniq
end
end
...
@@ -149,8 +151,8 @@ module Issuable
...
@@ -149,8 +151,8 @@ module Issuable
def
add_labels_by_names
(
label_names
)
def
add_labels_by_names
(
label_names
)
label_names
.
each
do
|
label_name
|
label_names
.
each
do
|
label_name
|
label
=
project
.
labels
.
create_with
(
label
=
project
.
labels
.
create_with
(
color:
Label
::
DEFAULT_COLOR
).
color:
Label
::
DEFAULT_COLOR
).
find_or_create_by
(
title:
label_name
.
strip
)
find_or_create_by
(
title:
label_name
.
strip
)
self
.
labels
<<
label
self
.
labels
<<
label
end
end
end
end
...
@@ -159,11 +161,13 @@ module Issuable
...
@@ -159,11 +161,13 @@ module Issuable
def
filter_superceded_votes
(
votes
,
notes
)
def
filter_superceded_votes
(
votes
,
notes
)
filteredvotes
=
[]
+
votes
filteredvotes
=
[]
+
votes
votes
.
each
do
|
vote
|
votes
.
each
do
|
vote
|
if
vote
.
superceded?
(
notes
)
if
vote
.
superceded?
(
notes
)
filteredvotes
.
delete
(
vote
)
filteredvotes
.
delete
(
vote
)
end
end
end
end
filteredvotes
filteredvotes
end
end
end
end
app/models/note.rb
View file @
a5b255fb
...
@@ -461,14 +461,17 @@ class Note < ActiveRecord::Base
...
@@ -461,14 +461,17 @@ class Note < ActiveRecord::Base
def
superceded?
(
notes
)
def
superceded?
(
notes
)
return
false
unless
vote?
return
false
unless
vote?
notes
.
each
do
|
note
|
notes
.
each
do
|
note
|
next
if
note
==
self
next
if
note
==
self
if
note
.
vote?
&&
if
note
.
vote?
&&
self
[
:author_id
]
==
note
[
:author_id
]
&&
self
[
:author_id
]
==
note
[
:author_id
]
&&
self
[
:created_at
]
<=
note
[
:created_at
]
self
[
:created_at
]
<=
note
[
:created_at
]
return
true
return
true
end
end
end
end
false
false
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