diff options
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r-- | app/models/snippet.rb | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 9ec685c5580..8ed5513aab9 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -183,7 +183,7 @@ class Snippet < ApplicationRecord end def link_reference_pattern - @link_reference_pattern ||= super("snippets", /(?<snippet>\d+)/) + @link_reference_pattern ||= compose_link_reference_pattern('snippets', /(?<snippet>\d+)/) end def find_by_id_and_project(id:, project:) @@ -203,14 +203,7 @@ class Snippet < ApplicationRecord end def initialize(attributes = {}) - # We can't use default_value_for because the database has a default - # value of 0 for visibility_level. If someone attempts to create a - # private snippet, default_value_for will assume that the - # visibility_level hasn't changed and will use the application - # setting default, which could be internal or public. - # - # To fix the problem, we assign the actual snippet default if no - # explicit visibility has been initialized. + # We assign the actual snippet default if no explicit visibility has been initialized. attributes ||= {} unless visibility_attribute_present?(attributes) |