Skip to content

Commit

Permalink
Rename method to make explicit its intention
Browse files Browse the repository at this point in the history
call is too generic
  • Loading branch information
rafaelfranca committed Feb 5, 2015
1 parent 003c0cd commit 4b4e228
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion actionview/lib/action_view/helpers/tags/label.rb
Expand Up @@ -18,7 +18,7 @@ def translation

content ||= Translator
.new(object, @object_name, method_and_value, scope: "helpers.label")
.call
.translate
content ||= @method_name.humanize

content
Expand Down
2 changes: 1 addition & 1 deletion actionview/lib/action_view/helpers/tags/placeholderable.rb
Expand Up @@ -11,7 +11,7 @@ def initialize(*)

placeholder ||= Tags::Translator
.new(object, @object_name, method_and_value, scope: "helpers.placeholder")
.call
.translate
placeholder ||= @method_name.humanize
@options[:placeholder] = placeholder
end
Expand Down
2 changes: 1 addition & 1 deletion actionview/lib/action_view/helpers/tags/translator.rb
Expand Up @@ -9,7 +9,7 @@ def initialize(object, object_name, method_and_value, scope:)
@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
Expand Down

0 comments on commit 4b4e228

Please sign in to comment.