Class: Banzai::ReferenceParser::ExternalIssueParser
- Inherits:
-
BaseParser
- Object
- BaseParser
- Banzai::ReferenceParser::ExternalIssueParser
- Defined in:
- lib/banzai/reference_parser/external_issue_parser.rb
Instance Method Summary collapse
-
#can_read_reference?(user, ref_project, node) ⇒ Boolean
we extract only external issue trackers references here, we don’t extract cross-project references, so we don’t need to do anything here.
- #issue_ids_per_project(nodes) ⇒ Object
- #nodes_visible_to_user(user, nodes) ⇒ Object
- #referenced_by(nodes, options = {}) ⇒ Object
Methods inherited from BaseParser
#can?, #collection_cache_key, #collection_objects_for_ids, data_attribute, #find_projects_for_hash_keys, #gather_attributes_per_project, #gather_references, #grouped_objects_for_nodes, #initialize, #nodes_user_can_reference, #process, #project_for_node, #projects_for_nodes, reference_class, #references_relation, #unique_attribute_values
Constructor Details
This class inherits a constructor from Banzai::ReferenceParser::BaseParser
Instance Method Details
#can_read_reference?(user, ref_project, node) ⇒ Boolean
we extract only external issue trackers references here, we don’t extract cross-project references, so we don’t need to do anything here.
28 29 30 |
# File 'lib/banzai/reference_parser/external_issue_parser.rb', line 28 def can_read_reference?(user, ref_project, node) true end |
#issue_ids_per_project(nodes) ⇒ Object
22 23 24 |
# File 'lib/banzai/reference_parser/external_issue_parser.rb', line 22 def issue_ids_per_project(nodes) gather_attributes_per_project(nodes, self.class.data_attribute) end |
#nodes_visible_to_user(user, nodes) ⇒ Object
32 33 34 |
# File 'lib/banzai/reference_parser/external_issue_parser.rb', line 32 def nodes_visible_to_user(user, nodes) nodes end |
#referenced_by(nodes, options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/banzai/reference_parser/external_issue_parser.rb', line 8 def referenced_by(nodes, = {}) issue_ids = issue_ids_per_project(nodes) projects = find_projects_for_hash_keys(issue_ids) issues = [] projects.each do |project| issue_ids[project.id].each do |id| issues << ExternalIssue.new(id, project) end end issues end |