Method: Pageflow::PublishedEntry#translations

Defined in:
app/models/pageflow/published_entry.rb

#translations(scope = -> { self }, include_noindex: false) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/models/pageflow/published_entry.rb', line 23

def translations(scope = -> { self }, include_noindex: false)
  return [] unless entry.translation_group

  if published_revision?
    self.class.wrap_all(
      published_translation_entries(include_noindex:).instance_exec(&scope)
    )
  else
    self.class.wrap_all_drafts(
      entry.translation_group.entries.instance_exec(&scope)
    )
  end
end