diff --git a/app/helpers/globalize_helper.rb b/app/helpers/globalize_helper.rb index f9bedca9f..13e9ec3d4 100644 --- a/app/helpers/globalize_helper.rb +++ b/app/helpers/globalize_helper.rb @@ -130,9 +130,7 @@ module GlobalizeHelper hidden_field_tag("enabled_translations[#{locale}]", (enabled ? 1 : 0)) end - def globalize(locale) - Globalize.with_locale(locale) do - yield - end + def globalize(locale, &block) + Globalize.with_locale(locale, &block) end end diff --git a/app/helpers/translatable_form_helper.rb b/app/helpers/translatable_form_helper.rb index 1cc3014b3..fea9b04ef 100644 --- a/app/helpers/translatable_form_helper.rb +++ b/app/helpers/translatable_form_helper.rb @@ -1,8 +1,6 @@ module TranslatableFormHelper - def translatable_form_for(record, options = {}) - form_for(record, options.merge(builder: TranslatableFormBuilder)) do |f| - yield(f) - end + def translatable_form_for(record, options = {}, &block) + form_for(record, options.merge(builder: TranslatableFormBuilder), &block) end def translations_interface_enabled? @@ -48,10 +46,8 @@ module TranslatableFormHelper end end - def fields_for_translation(translation) - fields_for(:translations, translation, builder: TranslationsFieldsBuilder) do |f| - yield f - end + def fields_for_translation(translation, &block) + fields_for(:translations, translation, builder: TranslationsFieldsBuilder, &block) end def translation_for(locale) diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index f1cf3f0db..0c0f8ebfe 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -129,10 +129,8 @@ class Mailer < ApplicationMailer private - def with_user(user) - I18n.with_locale(user.locale) do - yield - end + def with_user(user, &block) + I18n.with_locale(user.locale, &block) end def prevent_delivery_to_users_without_email