Add and apply Style/ExplicitBlockArgument rule
We were already applying it in most places.
This commit is contained in:
@@ -130,9 +130,7 @@ module GlobalizeHelper
|
|||||||
hidden_field_tag("enabled_translations[#{locale}]", (enabled ? 1 : 0))
|
hidden_field_tag("enabled_translations[#{locale}]", (enabled ? 1 : 0))
|
||||||
end
|
end
|
||||||
|
|
||||||
def globalize(locale)
|
def globalize(locale, &block)
|
||||||
Globalize.with_locale(locale) do
|
Globalize.with_locale(locale, &block)
|
||||||
yield
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
module TranslatableFormHelper
|
module TranslatableFormHelper
|
||||||
def translatable_form_for(record, options = {})
|
def translatable_form_for(record, options = {}, &block)
|
||||||
form_for(record, options.merge(builder: TranslatableFormBuilder)) do |f|
|
form_for(record, options.merge(builder: TranslatableFormBuilder), &block)
|
||||||
yield(f)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def translations_interface_enabled?
|
def translations_interface_enabled?
|
||||||
@@ -48,10 +46,8 @@ module TranslatableFormHelper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def fields_for_translation(translation)
|
def fields_for_translation(translation, &block)
|
||||||
fields_for(:translations, translation, builder: TranslationsFieldsBuilder) do |f|
|
fields_for(:translations, translation, builder: TranslationsFieldsBuilder, &block)
|
||||||
yield f
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def translation_for(locale)
|
def translation_for(locale)
|
||||||
|
|||||||
@@ -129,10 +129,8 @@ class Mailer < ApplicationMailer
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def with_user(user)
|
def with_user(user, &block)
|
||||||
I18n.with_locale(user.locale) do
|
I18n.with_locale(user.locale, &block)
|
||||||
yield
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def prevent_delivery_to_users_without_email
|
def prevent_delivery_to_users_without_email
|
||||||
|
|||||||
Reference in New Issue
Block a user