From 6e83330590eafc52aa65ed17f8764414fc16346a Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Sat, 7 May 2011 18:09:20 +0530 Subject: fixes incorrect error message for sample method --- activesupport/lib/active_support/core_ext/array/random_access.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext/array') diff --git a/activesupport/lib/active_support/core_ext/array/random_access.rb b/activesupport/lib/active_support/core_ext/array/random_access.rb index 9eba4642b8..bb1807a68a 100644 --- a/activesupport/lib/active_support/core_ext/array/random_access.rb +++ b/activesupport/lib/active_support/core_ext/array/random_access.rb @@ -7,7 +7,7 @@ class Array # # [1,2,3,4,5,6].sample # => 4 # [1,2,3,4,5,6].sample(3) # => [2, 4, 5] - # [1,2,3,4,5,6].sample(-3) # => ArgumentError: negative sample number + # [1,2,3,4,5,6].sample(-3) # => ArgumentError: negative array size # [].sample # => nil # [].sample(3) # => [] def sample(n=nil) -- cgit v1.2.3