Class: PersonalSnippet

Inherits:
Snippet show all
Includes:
WithUploads
Defined in:
app/models/personal_snippet.rb

Constant Summary

Constants included from WithUploads

WithUploads::FILE_UPLOADERS

Constants inherited from Snippet

Snippet::MAX_FILE_COUNT, Snippet::MAX_SINGLE_FILE_COUNT

Constants included from Gitlab::SQL::Pattern

Gitlab::SQL::Pattern::MIN_CHARS_FOR_PARTIAL_MATCHING, Gitlab::SQL::Pattern::REGEX_QUOTED_WORD

Constants included from Noteable

Noteable::MAX_NOTES_LIMIT

Constants included from CacheMarkdownField

CacheMarkdownField::INVALIDATED_BY

Constants included from Redactable

Redactable::UNSUBSCRIBE_PATTERN

Constants included from Gitlab::VisibilityLevel

Gitlab::VisibilityLevel::INTERNAL, Gitlab::VisibilityLevel::PRIVATE, Gitlab::VisibilityLevel::PUBLIC

Instance Attribute Summary

Attributes included from Noteable

#system_note_timestamp

Instance Method Summary collapse

Methods included from WithUploads

#retrieve_upload

Methods included from FastDestroyAll::Helpers

#perform_fast_destroy

Methods included from AfterCommitQueue

#run_after_commit, #run_after_commit_or_now

Methods inherited from Snippet

#allow_possible_spam?, #as_json, #blob, #blobs, #can_cache_field?, #check_for_spam?, #content_html_invalidated?, #create_repository, #default_content_html_invalidator, #embeddable?, #file_name, #file_name_on_repo, find_by_id_and_project, for_project_with_user, #full_path, #hexdigest, #hook_attrs, #initialize, link_reference_pattern, #list_files, max_file_limit, #multiple_files?, #notes_with_associations, only_include_authorized_projects, only_include_projects_visible_to, only_include_projects_with_snippets_enabled, only_personal_snippets, only_project_snippets, parent_class, reference_pattern, reference_prefix, #repository, #repository_size_checker, #repository_storage, sanitized_file_name, search, #spammable_entity_type, #storage, #to_ability_name, #to_reference, #track_snippet_repository, #valid_secret_token?, #visibility_level_field, visible_to_or_authored_by, with_optional_visibility

Methods included from Gitlab::Utils::Override

#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!

Methods included from HasRepository

#commit, #commit_by, #commits_by, #default_branch, #default_branch_from_preferences, #empty_repo?, #full_path, #http_url_to_repo, #reload_default_branch, #repo_exists?, #repository, #repository_exists?, #repository_size_checker, #root_ref?, #ssh_url_to_repo, #storage, #url_to_repo, #valid_repo?, #web_url

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Methods included from Gitlab::ShellAdapter

#gitlab_shell

Methods included from Referable

#referable_inspect, #reference_link_text, #to_reference, #to_reference_base

Methods included from Editable

#edited?, #last_edited_by

Methods included from Spammable

#allow_possible_spam?, #check_for_spam?, #clear_spam_flags!, #invalidate_if_spam, #needs_recaptcha!, #recaptcha_error!, #spam!, #spam_description, #spam_title, #spammable_entity_type, #spammable_text, #submittable_as_spam?, #submittable_as_spam_by?, #unrecoverable_spam_error!

Methods included from Mentionable

#all_references, #create_cross_references!, #create_new_cross_references!, #directly_addressed_users, #extractors, #gfm_reference, #local_reference, #matches_cross_reference_regex?, #mentioned_users, #referenced_group_users, #referenced_groups, #referenced_mentionables, #referenced_project_users, #referenced_projects, #referenced_users, #store_mentions!

Methods included from Awardable

#awarded_emoji?, #downvotes, #emoji_awardable?, #grouped_awards, #upvotes, #user_authored?, #user_can_award?

Methods included from Participable

#participants

Methods included from Noteable

#after_note_created, #after_note_destroyed, #base_class_name, #capped_notes_count, #discussion_ids_relation, #discussion_notes, #discussions, #discussions_can_be_resolved_by?, #discussions_rendered_on_frontend?, #discussions_resolvable?, #discussions_resolved?, #discussions_to_be_resolved, #etag_caching_enabled?, #expire_note_etag_cache, #grouped_diff_discussions, #has_any_diff_note_positions?, #human_class_name, #lockable?, #note_etag_key, #preloads_discussion_diff_highlighting?, #resolvable_discussions, #supports_discussions?, #supports_replying_to_individual_notes?, #supports_resolvable_notes?, #supports_suggestion?

Methods included from CacheMarkdownField

#attribute_invalidated?, #banzai_render_context, #cached_html_for, #cached_html_up_to_date?, #can_cache_field?, #invalidated_markdown_cache?, #latest_cached_markdown_version, #local_version, #refresh_markdown_cache, #refresh_markdown_cache!, #rendered_field_content, #updated_cached_html_for

Methods included from Gitlab::VisibilityLevel

allowed_for?, allowed_level?, allowed_levels, closest_allowed_level, #internal?, level_name, level_value, levels_for_user, non_restricted_level?, options, #private?, #public?, public_visibility_restricted?, restricted_level?, string_level, string_options, string_values, valid_level?, #visibility, #visibility=, #visibility_attribute_present?, #visibility_level_attributes, #visibility_level_decreased?, #visibility_level_previous_changes, #visibility_level_value

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Constructor Details

This class inherits a constructor from Snippet

Instance Method Details

#parent_userObject


6
7
8
# File 'app/models/personal_snippet.rb', line 6

def parent_user
  author
end

#skip_project_check?Boolean

Returns:

  • (Boolean)

10
11
12
# File 'app/models/personal_snippet.rb', line 10

def skip_project_check?
  true
end