From 88080e262928f8b3fc8eb0241a09ea5b3c559725 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Tue, 7 Oct 2014 19:51:55 +0900 Subject: The code was not up-to-date --- guides/source/active_support_core_extensions.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'guides') diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index de42f13145..f6f96b79c6 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -1833,16 +1833,14 @@ attribute names: ```ruby def full_messages - full_messages = [] - - each do |attribute, messages| - ... - attr_name = attribute.to_s.gsub('.', '_').humanize - attr_name = @base.class.human_attribute_name(attribute, default: attr_name) - ... - end + map { |attribute, message| full_message(attribute, message) } +end - full_messages +def full_message + ... + attr_name = attribute.to_s.tr('.', '_').humanize + attr_name = @base.class.human_attribute_name(attribute, default: attr_name) + ... end ``` -- cgit v1.2.3