aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorErik Michaels-Ober <sferik@gmail.com>2014-10-13 11:54:04 +0100
committerErik Michaels-Ober <sferik@gmail.com>2014-10-13 11:54:04 +0100
commit2b6bacd1927830e23bf99ed319a067c004ae92ac (patch)
tree89bc0ccbd1c54cddc4e9665443f8609f23c5c93c /actionpack
parent996aab576eefb351025ae1d56371f41a0eb074c5 (diff)
downloadrails-2b6bacd1927830e23bf99ed319a067c004ae92ac.tar.gz
rails-2b6bacd1927830e23bf99ed319a067c004ae92ac.tar.bz2
rails-2b6bacd1927830e23bf99ed319a067c004ae92ac.zip
Replace Array#shuffle.first with Array#sample
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/journey/gtg/transition_table.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb b/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb
index 990d2127ee..1b914f0637 100644
--- a/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb
+++ b/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb
@@ -88,13 +88,13 @@ module ActionDispatch
erb = File.read File.join(viz_dir, 'index.html.erb')
states = "function tt() { return #{to_json}; }"
- fun_routes = paths.shuffle.first(3).map do |ast|
+ fun_routes = paths.sample(3).map do |ast|
ast.map { |n|
case n
when Nodes::Symbol
case n.left
when ':id' then rand(100).to_s
- when ':format' then %w{ xml json }.shuffle.first
+ when ':format' then %w{ xml json }.sample
else
'omg'
end