aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-08-17 23:02:47 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-08-17 23:02:47 -0300
commit352da06503e96a2aa6ef40342060deb1f07ed683 (patch)
tree85cc3668657f7902e7def1cec7824392a23cc4d9
parent0b476de445faf330c58255e2ec3eea0f3a7c1bfc (diff)
parenta94c2e1f23c4216a5b854c13f439882311fda461 (diff)
downloadrails-352da06503e96a2aa6ef40342060deb1f07ed683.tar.gz
rails-352da06503e96a2aa6ef40342060deb1f07ed683.tar.bz2
rails-352da06503e96a2aa6ef40342060deb1f07ed683.zip
Merge pull request #21278 from byroot/try-arity-check
Use == 0 instead of .zero? in #try
-rw-r--r--activesupport/lib/active_support/core_ext/object/try.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/try.rb b/activesupport/lib/active_support/core_ext/object/try.rb
index 69be6c4abc..c67eb25b68 100644
--- a/activesupport/lib/active_support/core_ext/object/try.rb
+++ b/activesupport/lib/active_support/core_ext/object/try.rb
@@ -8,7 +8,7 @@ module ActiveSupport
def try!(*a, &b)
if a.empty? && block_given?
- if b.arity.zero?
+ if b.arity == 0
instance_eval(&b)
else
yield self