Class: Decidim::TermCustomizer::Admin::TranslationsDestroyForm

Inherits:
Form
  • Object
show all
Defined in:
app/forms/decidim/term_customizer/admin/translations_destroy_form.rb

Overview

A form object to be used when admin users wants to destroy multiple translations at once.

Instance Method Summary collapse

Instance Method Details

#translationsObject

Translations for all locales corresponding the translations passed to the form.



18
19
20
21
22
23
24
# File 'app/forms/decidim/term_customizer/admin/translations_destroy_form.rb', line 18

def translations
  return [] unless translation_set

  @translations ||= translation_set.translations.where(
    key: translation_keys
  ).order(:id)
end

#translations_currentObject

Only the translations passed with the IDs (current locale).



27
28
29
30
31
32
33
# File 'app/forms/decidim/term_customizer/admin/translations_destroy_form.rb', line 27

def translations_current
  return [] unless translation_set

  @translations_current ||= translation_set.translations.where(
    id: translation_ids.uniq
  ).order(:id)
end