diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index 8c11b2a11a..dc1200812e 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -167,6 +167,12 @@ def log_info(sql, name, ms) end ++try+ can also be called without arguments but a block, which will only be executed if the object is not nil: + + +@person.try { |p| "#{p.first_name} #{p.last_name}" } + + NOTE: Defined in +active_support/core_ext/object/try.rb+. h4. +singleton_class+