diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-06-13 17:34:17 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-06-13 17:34:17 -0500 |
commit | ba0f38f89e8473490270957849d7d5b06f6ee65b (patch) | |
tree | 6bf2d17d3b4081ec432095a6442f7b8ee30024f3 /activesupport | |
parent | eea4fe4c902e71249d77b3103eade3dec905f98a (diff) | |
download | rails-ba0f38f89e8473490270957849d7d5b06f6ee65b.tar.gz rails-ba0f38f89e8473490270957849d7d5b06f6ee65b.tar.bz2 rails-ba0f38f89e8473490270957849d7d5b06f6ee65b.zip |
Change Enumberal#several? to Enumberal#many?
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/CHANGELOG | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/enumerable.rb | 2 | ||||
-rw-r--r-- | activesupport/test/core_ext/enumerable_test.rb | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index 0272b08215..1267f05c75 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -4,7 +4,7 @@ * Added Object#present? which is equivalent to !Object#blank? [DHH] -* Added Enumberable#several? to encapsulate collection.size > 1 [DHH] +* Added Enumberable#many? to encapsulate collection.size > 1 [DHH] * Add more standard Hash methods to ActiveSupport::OrderedHash [Steve Purcell] diff --git a/activesupport/lib/active_support/core_ext/enumerable.rb b/activesupport/lib/active_support/core_ext/enumerable.rb index 8e148cc1b4..9647797ec2 100644 --- a/activesupport/lib/active_support/core_ext/enumerable.rb +++ b/activesupport/lib/active_support/core_ext/enumerable.rb @@ -79,7 +79,7 @@ module Enumerable end # Returns true if the collection has more than 1 element. Functionally equivalent to collection.size > 1. - def several? + def many? size > 1 end end diff --git a/activesupport/test/core_ext/enumerable_test.rb b/activesupport/test/core_ext/enumerable_test.rb index c37e0d269e..fb9b9b8916 100644 --- a/activesupport/test/core_ext/enumerable_test.rb +++ b/activesupport/test/core_ext/enumerable_test.rb @@ -65,8 +65,8 @@ class EnumerableTests < Test::Unit::TestCase end def test_several - assert ![].several? - assert ![ 1 ].several? - assert [ 1, 2 ].several? + assert ![].many? + assert ![ 1 ].many? + assert [ 1, 2 ].many? end end |