Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.1 on 2022-01-26 at 16:00 UTC+1 (a few minutes of down time)

Commit fc2c64fc authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Add self.project_foreign_key on both Issue and MergeRequest

parent a700ed88e51d
......@@ -145,16 +145,10 @@ def sort(method, excluded_labels: [])
end
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 = {
target_type: name,
target_column: "#{table_name}.id",
project_column: project_column,
project_column: "#{table_name}.#{project_foreign_key}",
excluded_labels: excluded_labels
}
......
......@@ -138,6 +138,10 @@ def self.reference_valid?(reference)
reference.to_i > 0 && reference.to_i <= Gitlab::Database::MAX_INT_VALUE
end
def self.project_foreign_key
'project_id'
end
def self.sort(method, excluded_labels: [])
case method.to_s
when 'due_date_asc' then order_due_date_asc
......
......@@ -137,6 +137,10 @@ def self.reference_valid?(reference)
reference.to_i > 0 && reference.to_i <= Gitlab::Database::MAX_INT_VALUE
end
def self.project_foreign_key
'target_project_id'
end
# Returns all the merge requests from an ActiveRecord:Relation.
#
# This method uses a UNION as it usually operates on the result of
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment