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
fc2c64fc
Commit
fc2c64fc
authored
Oct 19, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add self.project_foreign_key on both Issue and MergeRequest
parent
2ed51e7e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+1
-7
app/models/issue.rb
app/models/issue.rb
+4
-0
app/models/merge_request.rb
app/models/merge_request.rb
+4
-0
No files found.
app/models/concerns/issuable.rb
View file @
fc2c64fc
...
@@ -145,16 +145,10 @@ module Issuable
...
@@ -145,16 +145,10 @@ module Issuable
end
end
def
order_labels_priority
(
excluded_labels:
[])
def
order_labels_priority
(
excluded_labels:
[])
project_column
=
case
table_name
when
Issue
.
table_name
then
"
#{
table_name
}
.project_id"
when
MergeRequest
.
table_name
then
"
#{
table_name
}
.target_project_id"
end
params
=
{
params
=
{
target_type:
name
,
target_type:
name
,
target_column:
"
#{
table_name
}
.id"
,
target_column:
"
#{
table_name
}
.id"
,
project_column:
project_column
,
project_column:
"
#{
table_name
}
.
#{
project_foreign_key
}
"
,
excluded_labels:
excluded_labels
excluded_labels:
excluded_labels
}
}
...
...
app/models/issue.rb
View file @
fc2c64fc
...
@@ -138,6 +138,10 @@ class Issue < ActiveRecord::Base
...
@@ -138,6 +138,10 @@ class Issue < ActiveRecord::Base
reference
.
to_i
>
0
&&
reference
.
to_i
<=
Gitlab
::
Database
::
MAX_INT_VALUE
reference
.
to_i
>
0
&&
reference
.
to_i
<=
Gitlab
::
Database
::
MAX_INT_VALUE
end
end
def
self
.
project_foreign_key
'project_id'
end
def
self
.
sort
(
method
,
excluded_labels:
[])
def
self
.
sort
(
method
,
excluded_labels:
[])
case
method
.
to_s
case
method
.
to_s
when
'due_date_asc'
then
order_due_date_asc
when
'due_date_asc'
then
order_due_date_asc
...
...
app/models/merge_request.rb
View file @
fc2c64fc
...
@@ -137,6 +137,10 @@ class MergeRequest < ActiveRecord::Base
...
@@ -137,6 +137,10 @@ class MergeRequest < ActiveRecord::Base
reference
.
to_i
>
0
&&
reference
.
to_i
<=
Gitlab
::
Database
::
MAX_INT_VALUE
reference
.
to_i
>
0
&&
reference
.
to_i
<=
Gitlab
::
Database
::
MAX_INT_VALUE
end
end
def
self
.
project_foreign_key
'target_project_id'
end
# Returns all the merge requests from an ActiveRecord:Relation.
# Returns all the merge requests from an ActiveRecord:Relation.
#
#
# This method uses a UNION as it usually operates on the result of
# This method uses a UNION as it usually operates on the result of
...
...
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