summaryrefslogtreecommitdiff
path: root/lib/gitlab/template/base_template.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/template/base_template.rb')
-rw-r--r--lib/gitlab/template/base_template.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/gitlab/template/base_template.rb b/lib/gitlab/template/base_template.rb
index 3770f3f250b..4456217017f 100644
--- a/lib/gitlab/template/base_template.rb
+++ b/lib/gitlab/template/base_template.rb
@@ -12,14 +12,21 @@ module Gitlab
def name
File.basename(@path, self.class.extension)
end
- alias_method :id, :name
+ alias_method :key, :name
def content
@finder.read(@path)
end
+ # Present for compatibility with license templates, which can replace text
+ # like `[fullname]` with a user-specified string. This is a no-op for
+ # other templates
+ def resolve!(_placeholders = {})
+ self
+ end
+
def to_json
- { name: name, content: content }
+ { key: key, name: name, content: content }
end
def <=>(other)