Class: Gitlab::LegacyGithubImport::IssuableFormatter
- Inherits:
-
BaseFormatter
- Object
- BaseFormatter
- Gitlab::LegacyGithubImport::IssuableFormatter
- Includes:
- Import::UsernameMentionRewriter
- Defined in:
- lib/gitlab/legacy_github_import/issuable_formatter.rb
Direct Known Subclasses
Constant Summary
Constants included from Import::UsernameMentionRewriter
Import::UsernameMentionRewriter::MENTION_REGEX
Instance Attribute Summary collapse
-
#assignee_id ⇒ Object
writeonly
Sets the attribute assignee_id.
-
#author_id ⇒ Object
writeonly
Sets the attribute author_id.
Attributes inherited from BaseFormatter
#client, #formatter, #project, #raw_data, #source_user_mapper
Instance Method Summary collapse
- #contributing_assignee_formatters ⇒ Object
- #create! ⇒ Object
- #find_condition ⇒ Object
- #number ⇒ Object
- #project_assignee_association ⇒ Object
- #project_association ⇒ Object
Methods included from Import::UsernameMentionRewriter
#update_username_mentions, #wrap_mentions_in_backticks
Methods inherited from BaseFormatter
#contributing_user_formatters, #create_record, #imported_from, #initialize, #push_placeholder_reference, #push_placeholder_references, #url
Constructor Details
This class inherits a constructor from Gitlab::LegacyGithubImport::BaseFormatter
Instance Attribute Details
#assignee_id=(value) ⇒ Object
Sets the attribute assignee_id
8 9 10 |
# File 'lib/gitlab/legacy_github_import/issuable_formatter.rb', line 8 def assignee_id=(value) @assignee_id = value end |
#author_id=(value) ⇒ Object
Sets the attribute author_id
8 9 10 |
# File 'lib/gitlab/legacy_github_import/issuable_formatter.rb', line 8 def (value) @author_id = value end |
Instance Method Details
#contributing_assignee_formatters ⇒ Object
38 39 40 |
# File 'lib/gitlab/legacy_github_import/issuable_formatter.rb', line 38 def contributing_assignee_formatters raise NotImplementedError end |
#create! ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/gitlab/legacy_github_import/issuable_formatter.rb', line 22 def create! record = super return record unless assignee_id # Fetch first assignee because Gitea's API only returns one assignee for issue assignees assignee_record = record.method(project_assignee_association).call.first push_placeholder_references(assignee_record, contributing_users: contributing_assignee_formatters) record end |
#find_condition ⇒ Object
18 19 20 |
# File 'lib/gitlab/legacy_github_import/issuable_formatter.rb', line 18 def find_condition { iid: number } end |
#number ⇒ Object
14 15 16 |
# File 'lib/gitlab/legacy_github_import/issuable_formatter.rb', line 14 def number raw_data[:number] end |
#project_assignee_association ⇒ Object
34 35 36 |
# File 'lib/gitlab/legacy_github_import/issuable_formatter.rb', line 34 def project_assignee_association raise NotImplementedError end |
#project_association ⇒ Object
10 11 12 |
# File 'lib/gitlab/legacy_github_import/issuable_formatter.rb', line 10 def project_association raise NotImplementedError end |