From 1255aa5032199c3510a77dc40ccbc15c8408b257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 11 Oct 2018 12:03:35 +0200 Subject: [PATCH] Make private methods private --- app/helpers/translatable_form_helper.rb | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/helpers/translatable_form_helper.rb b/app/helpers/translatable_form_helper.rb index decab4dd7..e07b71435 100644 --- a/app/helpers/translatable_form_helper.rb +++ b/app/helpers/translatable_form_helper.rb @@ -25,24 +25,24 @@ module TranslatableFormHelper end.join.html_safe end - def translation_for(locale) - existing_translation_for(locale) || new_translation_for(locale) - end - - def existing_translation_for(locale) - # Use `select` because `where` uses the database and so ignores - # the `params` sent by the browser - @object.translations.select { |translation| translation.locale == locale }.first - end - - def new_translation_for(locale) - @object.translations.new(locale: locale).tap do |translation| - translation.mark_for_destruction unless locale == I18n.locale - end - end - private + def translation_for(locale) + existing_translation_for(locale) || new_translation_for(locale) + end + + def existing_translation_for(locale) + # Use `select` because `where` uses the database and so ignores + # the `params` sent by the browser + @object.translations.select { |translation| translation.locale == locale }.first + end + + def new_translation_for(locale) + @object.translations.new(locale: locale).tap do |translation| + translation.mark_for_destruction unless locale == I18n.locale + end + end + def translations_options(resource, locale) { class: " js-globalize-attribute",