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

Constants included from CanMoveRepositoryStorage

CanMoveRepositoryStorage::RepositoryReadOnlyError

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

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Instance Attribute Summary

Attributes included from Noteable

#system_note_timestamp

Attributes included from CacheMarkdownField

#skip_markdown_cache_validation

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

#all_files, #allow_possible_spam?, #as_json, #blob, #blobs, #can_cache_field?, #check_for_spam?, #content_html_invalidated?, #create_repository, #default_branch, #default_content_html_invalidator, #embeddable?, #file_name, #file_name_on_repo, find_by_id_and_project, find_by_project_title_trunc_created_at, 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 CanMoveRepositoryStorage

#git_transfer_in_progress?, #reference_counter, #set_repository_read_only!, #set_repository_writable!

Methods included from HasRepository

#after_change_head_branch_does_not_exist, #after_repository_change_head, #commit, #commit_by, #commits_by, #default_branch, #default_branch_from_group_preferences, #default_branch_from_preferences, #empty_repo?, #full_path, #http_url_to_repo, #lfs_enabled?, #lfs_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!, #render_recaptcha?, #spam, #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, #user_mention_class, #user_mention_identifier

Methods included from Awardable

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

Methods included from Participable

#participant?, #participants, #visible_participants

Methods included from Noteable

#after_note_created, #after_note_destroyed, #base_class_name, #capped_notes_count, #creatable_note_email_address, #discussion_ids_relation, #discussion_notes, #discussion_root_note_ids, #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, #noteable_target_type_name, #preloads_discussion_diff_highlighting?, #resolvable_discussions, #supports_creating_notes_by_email?, #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, #mentionable_attributes_changed?, #mentioned_filtered_user_ids_for, #refresh_markdown_cache, #refresh_markdown_cache!, #rendered_field_content, #store_mentions!, #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_attribute_value, #visibility_level_attributes, #visibility_level_previous_changes, #visibility_level_value

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

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