Class: Maglev::ContentSourceGraph

Inherits:
Object
  • Object
show all
Defined in:
lib/maglev/content_source_graph.rb

Class Method Summary collapse

Class Method Details

.register(config) ⇒ Object



8
9
10
11
# File 'lib/maglev/content_source_graph.rb', line 8

def register(config)
  register_active_storage if config.attached_sources.any?
  register_action_text if config.rich_text_sources.any?
end

.reindex_attachment_owner(attachment) ⇒ Object



13
14
15
16
17
18
# File 'lib/maglev/content_source_graph.rb', line 13

def reindex_attachment_owner(attachment)
  record = attachment.record
  return unless record && declared_attached?(record.class, attachment.name)

  ReindexJob.perform_later(record.class.name, record.id) if record.id
end

.reindex_rich_text_owner(rich_text) ⇒ Object



20
21
22
23
24
25
# File 'lib/maglev/content_source_graph.rb', line 20

def reindex_rich_text_owner(rich_text)
  record = rich_text.record
  return unless record && declared_rich_text?(record.class, rich_text.name)

  ReindexJob.perform_later(record.class.name, record.id) if record.id
end