summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-06 06:09:19 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-06 06:09:19 +0000
commitcce8cf03d3bebe8b05375e4db0004328f84b28a2 (patch)
treec4fe6a257e894b6ce226a36f275f35675025c299 /app/models/project.rb
parentf098e6d3d2c8eaaec0a228c8a3ae01f770e15dd2 (diff)
downloadgitlab-ce-cce8cf03d3bebe8b05375e4db0004328f84b28a2.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 93ac9b64a98..cc7a732d94a 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -314,6 +314,7 @@ class Project < ApplicationRecord
has_one :pages_metadatum, class_name: 'ProjectPagesMetadatum', inverse_of: :project
has_many :import_failures, inverse_of: :project
+ has_many :jira_imports, -> { order 'jira_imports.created_at' }, class_name: 'JiraImportState', inverse_of: :project
has_many :daily_report_results, class_name: 'Ci::DailyReportResult'
@@ -2424,6 +2425,10 @@ class Project < ApplicationRecord
environments.where("name LIKE (#{::Gitlab::SQL::Glob.to_like(quoted_scope)})") # rubocop:disable GitlabSecurity/SqlInjection
end
+ def latest_jira_import
+ jira_imports.last
+ end
+
private
def find_service(services, name)