2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
class ProjectSnippet < Snippet
|
|
|
|
belongs_to :project
|
|
|
|
|
|
|
|
validates :project, presence: true
|
2020-01-01 13:55:28 +05:30
|
|
|
validates :secret, inclusion: { in: [false] }
|
2020-03-13 15:44:24 +05:30
|
|
|
|
|
|
|
def web_url(only_path: nil)
|
|
|
|
Gitlab::Routing.url_helpers.project_snippet_url(project, self, only_path: only_path)
|
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|