about summary refs log tree commit diff stats
path: root/app/controllers/quotes_controller.rb
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-03-20 11:01:50 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-03-20 11:01:50 -0400
commit17c72a9bd8a624a2bc0aa4c806199ba8648ce4cc (patch)
treeb43debf495f2ab8732179bccd47e65fc5bb05a5b /app/controllers/quotes_controller.rb
parent5462a1e56abf70486dc59593dde6ecb95a072026 (diff)
downloadthoughts-master.tar.gz
thoughts-master.tar.bz2
thoughts-master.zip
Restrict quotes#random to published quotes HEAD master
Diffstat (limited to 'app/controllers/quotes_controller.rb')
-rw-r--r--app/controllers/quotes_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/quotes_controller.rb b/app/controllers/quotes_controller.rb index b6ddb6a..6fa03f2 100644 --- a/app/controllers/quotes_controller.rb +++ b/app/controllers/quotes_controller.rb
@@ -29,7 +29,7 @@ class QuotesController < ApplicationController
29 end 29 end
30 30
31 def random 31 def random
32 picked = Quote.ids.sample 32 picked = Quote.where(state: :published).ids.sample
33 redirect_to quote_url(picked) 33 redirect_to quote_url(picked)
34 end 34 end
35 35