add an alias for Snippet#path

This commit is contained in:
http://jneen.net/ 2016-06-16 11:55:04 -07:00
parent 9fc53864dd
commit 5ff8371c5e
1 changed files with 6 additions and 0 deletions

View File

@ -20,6 +20,12 @@ class Snippet < ActiveRecord::Base
length: { within: 0..255 },
format: { with: Gitlab::Regex.file_name_regex,
message: Gitlab::Regex.file_name_regex_message }
# [jneen] alias for compatibility with blobs and highlighting
def path
file_name
end
validates :content, presence: true
validates :visibility_level, inclusion: { in: Gitlab::VisibilityLevel.values }