Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-26 15:09:15 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-26 15:09:15 +0300
commitc0dd450008c1cee260905e54bbed202891158697 (patch)
tree0b034d5e4568303b77302325fc8656bb040b90b4 /app/models
parent26bba9525deb5e9d05fd29cf5b286e7a65d1c791 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/merge_request.rb1
-rw-r--r--app/models/namespace.rb4
2 files changed, 5 insertions, 0 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 834d28f1e3c..133c6217bc0 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -316,6 +316,7 @@ class MergeRequest < ApplicationRecord
}
scope :with_csv_entity_associations, -> { preload(:assignees, :approved_by_users, :author, :milestone, metrics: [:merged_by]) }
+ scope :with_jira_integration_associations, -> { preload(:metrics, :assignees, :author, :target_project, :source_project) }
scope :by_target_branch_wildcard, ->(wildcard_branch_name) do
where("target_branch LIKE ?", ApplicationRecord.sanitize_sql_like(wildcard_branch_name).tr('*', '%'))
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 13ab542b5d9..7b7c2ea9d7b 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -343,6 +343,10 @@ class Namespace < ApplicationRecord
Plan.default
end
+ def paid?
+ root? && actual_plan.paid?
+ end
+
def actual_limits
# We default to PlanLimits.new otherwise a lot of specs would fail
# On production each plan should already have associated limits record