From 4b4e2281a08b827bbf997719bfe4a5b3085c3d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 5 Feb 2015 16:28:12 -0200 Subject: Rename method to make explicit its intention call is too generic --- actionview/lib/action_view/helpers/tags/label.rb | 2 +- actionview/lib/action_view/helpers/tags/placeholderable.rb | 2 +- actionview/lib/action_view/helpers/tags/translator.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'actionview/lib') diff --git a/actionview/lib/action_view/helpers/tags/label.rb b/actionview/lib/action_view/helpers/tags/label.rb index 4159cb105f..b31d5fda66 100644 --- a/actionview/lib/action_view/helpers/tags/label.rb +++ b/actionview/lib/action_view/helpers/tags/label.rb @@ -18,7 +18,7 @@ module ActionView content ||= Translator .new(object, @object_name, method_and_value, scope: "helpers.label") - .call + .translate content ||= @method_name.humanize content diff --git a/actionview/lib/action_view/helpers/tags/placeholderable.rb b/actionview/lib/action_view/helpers/tags/placeholderable.rb index db16ea7b0b..cf7b117614 100644 --- a/actionview/lib/action_view/helpers/tags/placeholderable.rb +++ b/actionview/lib/action_view/helpers/tags/placeholderable.rb @@ -11,7 +11,7 @@ module ActionView placeholder ||= Tags::Translator .new(object, @object_name, method_and_value, scope: "helpers.placeholder") - .call + .translate placeholder ||= @method_name.humanize @options[:placeholder] = placeholder end diff --git a/actionview/lib/action_view/helpers/tags/translator.rb b/actionview/lib/action_view/helpers/tags/translator.rb index 86d7d21308..829679851c 100644 --- a/actionview/lib/action_view/helpers/tags/translator.rb +++ b/actionview/lib/action_view/helpers/tags/translator.rb @@ -9,7 +9,7 @@ module ActionView @model = object.respond_to?(:to_model) ? object.to_model : object end - def call + def translate translated_attribute = I18n.t("#{object_name}.#{method_and_value}", default: i18n_default, scope: scope).presence translated_attribute || human_attribute_name end -- cgit v1.2.3