aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2014-10-13 14:08:43 +0200
committerXavier Noria <fxn@hashref.com>2014-10-13 14:08:43 +0200
commit0e08667464b6a7e2cc9393a0ac17f43a9904cf80 (patch)
treee55982c04ab876583cf8592234651bd49f89cebb
parent85901b44487a6dcc14f7c148384d6aa6b9282a4f (diff)
parent2b6bacd1927830e23bf99ed319a067c004ae92ac (diff)
downloadrails-0e08667464b6a7e2cc9393a0ac17f43a9904cf80.tar.gz
rails-0e08667464b6a7e2cc9393a0ac17f43a9904cf80.tar.bz2
rails-0e08667464b6a7e2cc9393a0ac17f43a9904cf80.zip
Merge pull request #17245 from sferik/sample
Replace Array#shuffle.first with Array#sample
-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