Class: Gitlab::BackgroundMigration::UserMentions::Models::Note
Constant Summary
CacheMarkdownField::INVALIDATED_BY
Instance Method Summary
collapse
#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, #parent_user, #refresh_markdown_cache, #refresh_markdown_cache!, #rendered_field_content, #updated_cached_html_for
#all_references, #array_to_sql, #build_mention_values, #extractors
Instance Method Details
#for_commit? ⇒ Boolean
51
52
53
|
# File 'lib/gitlab/background_migration/user_mentions/models/note.rb', line 51
def for_commit?
noteable_type == "Commit"
end
|
#for_epic? ⇒ Boolean
35
36
37
|
# File 'lib/gitlab/background_migration/user_mentions/models/note.rb', line 35
def for_epic?
noteable && noteable_type == 'Epic'
end
|
#for_personal_snippet? ⇒ Boolean
23
24
25
|
# File 'lib/gitlab/background_migration/user_mentions/models/note.rb', line 23
def for_personal_snippet?
noteable && noteable.class.name == 'PersonalSnippet'
end
|
#for_project_noteable? ⇒ Boolean
27
28
29
|
# File 'lib/gitlab/background_migration/user_mentions/models/note.rb', line 27
def for_project_noteable?
!for_personal_snippet? && !for_epic?
end
|
#noteable ⇒ Object
47
48
49
|
# File 'lib/gitlab/background_migration/user_mentions/models/note.rb', line 47
def noteable
super unless for_commit?
end
|
#skip_project_check? ⇒ Boolean
31
32
33
|
# File 'lib/gitlab/background_migration/user_mentions/models/note.rb', line 31
def skip_project_check?
!for_project_noteable?
end
|
#user_mention_note_id ⇒ Object
43
44
45
|
# File 'lib/gitlab/background_migration/user_mentions/models/note.rb', line 43
def user_mention_note_id
id
end
|
#user_mention_resource_id ⇒ Object
39
40
41
|
# File 'lib/gitlab/background_migration/user_mentions/models/note.rb', line 39
def user_mention_resource_id
noteable_id || commit_id
end
|