aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2014-10-07 19:51:55 +0900
committerAkira Matsuda <ronnie@dio.jp>2014-10-25 12:59:37 +0900
commit88080e262928f8b3fc8eb0241a09ea5b3c559725 (patch)
tree47cab0cb9f2ec18f103ed47cb3713312ba11fe87 /guides
parent9461583d3fe8b0269ebdf0ebefc1304f658f4bcd (diff)
downloadrails-88080e262928f8b3fc8eb0241a09ea5b3c559725.tar.gz
rails-88080e262928f8b3fc8eb0241a09ea5b3c559725.tar.bz2
rails-88080e262928f8b3fc8eb0241a09ea5b3c559725.zip
The code was not up-to-date
Diffstat (limited to 'guides')
-rw-r--r--guides/source/active_support_core_extensions.md16
1 files changed, 7 insertions, 9 deletions
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
```