Class: Gitlab::LegacyGithubImport::CommentFormatter
- Inherits:
-
BaseFormatter
- Object
- BaseFormatter
- Gitlab::LegacyGithubImport::CommentFormatter
- Includes:
- Import::UsernameMentionRewriter
- Defined in:
- lib/gitlab/legacy_github_import/comment_formatter.rb
Constant Summary
Constants included from Import::UsernameMentionRewriter
Import::UsernameMentionRewriter::MENTION_REGEX
Instance Attribute Summary collapse
-
#author_id ⇒ Object
writeonly
Sets the attribute author_id.
-
#gitlab_issuable ⇒ Object
Returns the value of attribute gitlab_issuable.
Attributes inherited from BaseFormatter
#client, #formatter, #project, #raw_data, #source_user_mapper
Instance Method Summary collapse
- #attributes ⇒ Object
- #contributing_user_formatters ⇒ Object
- #create_record ⇒ Object
- #project_association ⇒ Object
Methods included from Import::UsernameMentionRewriter
#update_username_mentions, #wrap_mentions_in_backticks
Methods inherited from BaseFormatter
#create!, #imported_from, #initialize, #push_placeholder_reference, #push_placeholder_references, #url
Constructor Details
This class inherits a constructor from Gitlab::LegacyGithubImport::BaseFormatter
Instance Attribute Details
#author_id=(value) ⇒ Object
Sets the attribute author_id
8 9 10 |
# File 'lib/gitlab/legacy_github_import/comment_formatter.rb', line 8 def (value) @author_id = value end |
#gitlab_issuable ⇒ Object
Returns the value of attribute gitlab_issuable.
10 11 12 |
# File 'lib/gitlab/legacy_github_import/comment_formatter.rb', line 10 def gitlab_issuable @gitlab_issuable end |
Instance Method Details
#attributes ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/gitlab/legacy_github_import/comment_formatter.rb', line 12 def attributes { project: project, note: note, commit_id: raw_data[:commit_id], line_code: line_code, author_id: , type: type, created_at: raw_data[:created_at], updated_at: raw_data[:updated_at], imported_from: imported_from } end |
#contributing_user_formatters ⇒ Object
34 35 36 37 38 |
# File 'lib/gitlab/legacy_github_import/comment_formatter.rb', line 34 def contributing_user_formatters { author_id: } end |
#create_record ⇒ Object
30 31 32 |
# File 'lib/gitlab/legacy_github_import/comment_formatter.rb', line 30 def create_record gitlab_issuable.notes.create!(attributes) end |
#project_association ⇒ Object
26 27 28 |
# File 'lib/gitlab/legacy_github_import/comment_formatter.rb', line 26 def project_association :notes end |