Class: Decidim::TermCustomizer::Admin::TranslationsDestroyForm
- Inherits:
-
Form
- Object
- Form
- Decidim::TermCustomizer::Admin::TranslationsDestroyForm
- 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
-
#translations ⇒ Object
Translations for all locales corresponding the translations passed to the form.
-
#translations_current ⇒ Object
Only the translations passed with the IDs (current locale).
Instance Method Details
#translations ⇒ Object
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_current ⇒ Object
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 |