Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change Enumberal#several? to Enumberal#many?

  • Loading branch information...
commit ba0f38f89e8473490270957849d7d5b06f6ee65b 1 parent eea4fe4
@dhh dhh authored
View
2  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]
View
2  activesupport/lib/active_support/core_ext/enumerable.rb
@@ -79,7 +79,7 @@ def index_by
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
View
6 activesupport/test/core_ext/enumerable_test.rb
@@ -65,8 +65,8 @@ def test_index_by
end
def test_several
- assert ![].several?
- assert ![ 1 ].several?
- assert [ 1, 2 ].several?
+ assert ![].many?
+ assert ![ 1 ].many?
+ assert [ 1, 2 ].many?
end
end

1 comment on commit ba0f38f

@Roman2K

Enumberable? And test_several should be renamed to test_many. Also, shouldn’t #many? only be added to classes that define #size? Not all Enumerable’s have a #size method (like Range).

Please sign in to comment.
Something went wrong with that request. Please try again.