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:
Diffstat (limited to 'app/models/license_template.rb')
-rw-r--r--app/models/license_template.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/license_template.rb b/app/models/license_template.rb
index bd24259984b..548066107c1 100644
--- a/app/models/license_template.rb
+++ b/app/models/license_template.rb
@@ -12,11 +12,12 @@ class LicenseTemplate
(fullname|name\sof\s(author|copyright\sowner))
[\>\}\]]}xi.freeze
- attr_reader :key, :name, :category, :nickname, :url, :meta
+ attr_reader :key, :name, :project, :category, :nickname, :url, :meta
- def initialize(key:, name:, category:, content:, nickname: nil, url: nil, meta: {})
+ def initialize(key:, name:, project:, category:, content:, nickname: nil, url: nil, meta: {})
@key = key
@name = name
+ @project = project
@category = category
@content = content
@nickname = nickname
@@ -24,6 +25,10 @@ class LicenseTemplate
@meta = meta
end
+ def project_id
+ project&.id
+ end
+
def popular?
category == :Popular
end