aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2009-01-13 13:28:14 -0800
committerYehuda Katz <wycats@gmail.com>2009-01-13 13:28:28 -0800
commit0932b012fae2ff21214f610a0fd78a55ae4e2420 (patch)
tree82b521a5ddf17c3bc4fd7762c95d49f29d31de15 /activesupport/lib/active_support/core_ext
parent6fe739ad752aeeaaf274ced6111685d2d6ed2eb8 (diff)
parent5a43908c7414996354ca427354d98d789e0210e7 (diff)
downloadrails-0932b012fae2ff21214f610a0fd78a55ae4e2420.tar.gz
rails-0932b012fae2ff21214f610a0fd78a55ae4e2420.tar.bz2
rails-0932b012fae2ff21214f610a0fd78a55ae4e2420.zip
Sync 'rails/rails/master'
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r--activesupport/lib/active_support/core_ext/object/misc.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/misc.rb b/activesupport/lib/active_support/core_ext/object/misc.rb
index 4570570bbc..c0a109ecf3 100644
--- a/activesupport/lib/active_support/core_ext/object/misc.rb
+++ b/activesupport/lib/active_support/core_ext/object/misc.rb
@@ -102,6 +102,6 @@ class Object
# Person.try(:find, 1)
# @people.try(:map) {|p| p.name}
def try(method, *args, &block)
- send(method, *args, &block) if respond_to?(method, true)
+ send(method, *args, &block) unless self.nil?
end
end