2018-07-25 09:30:33 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-03-24 15:26:49 +00:00
|
|
|
class ProjectSnippet < Snippet
|
|
|
|
belongs_to :project
|
|
|
|
|
|
|
|
validates :project, presence: true
|
2019-11-19 06:06:07 +00:00
|
|
|
validates :secret, inclusion: { in: [false] }
|
2020-02-13 15:08:52 +00:00
|
|
|
|
|
|
|
def web_url(only_path: nil)
|
|
|
|
Gitlab::Routing.url_helpers.project_snippet_url(project, self, only_path: only_path)
|
|
|
|
end
|
2013-03-24 15:26:49 +00:00
|
|
|
end
|