Class: Banzai::Filter::IssuableReferenceFilter

Inherits:
AbstractReferenceFilter show all
Defined in:
lib/banzai/filter/issuable_reference_filter.rb

Constant Summary

Constants inherited from AbstractReferenceFilter

AbstractReferenceFilter::REFERENCE_PLACEHOLDER, AbstractReferenceFilter::REFERENCE_PLACEHOLDER_PATTERN

Instance Method Summary collapse

Methods inherited from AbstractReferenceFilter

#call, #current_parent_path, #current_project_namespace_path, #data_attributes_for, #find_for_paths, #find_object_cached, #find_object_from_link, #find_object_from_link_cached, #from_ref_cached, identifier, #identifier, object_class, #object_class, #object_link_filter, #object_link_text, #object_link_text_extras, #object_link_title, object_name, object_sym, #object_sym, #parent_per_reference, parse_symbol, #records_per_parent, references_in, #references_in, #references_per_parent, #relation_for_paths, symbol_from_match, #url_for_object, #url_for_object_cached, #wrap_link

Methods inherited from ReferenceFilter

call, #call_and_update_nodes, #data_attribute, #each_node, #element_node?, #group, #ignore_ancestor_query, #initialize, #nodes, #project, #reference_class, #replace_link_node_with_href, #replace_link_node_with_text, #replace_text_when_pattern_matches, #skip_project_check?, #text_node?, #user, #validate, #yield_valid_link

Methods included from OutputSafety

#escape_once

Methods included from RequestStoreReferenceCache

#cached_call, #get_or_set_cache

Constructor Details

This class inherits a constructor from Banzai::Filter::ReferenceFilter

Instance Method Details

#find_object(parent, iid) ⇒ Object


10
11
12
# File 'lib/banzai/filter/issuable_reference_filter.rb', line 10

def find_object(parent, iid)
  records_per_parent[parent][iid]
end

#parent_from_ref(ref) ⇒ Object


14
15
16
# File 'lib/banzai/filter/issuable_reference_filter.rb', line 14

def parent_from_ref(ref)
  parent_per_reference[ref || current_parent_path]
end

#record_identifier(record) ⇒ Object


6
7
8
# File 'lib/banzai/filter/issuable_reference_filter.rb', line 6

def record_identifier(record)
  record.iid.to_i
end