diff options
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r-- | app/models/snippet.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb index f8034cb5e6b..40728d04574 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -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 } |