From 17c72a9bd8a624a2bc0aa4c806199ba8648ce4cc Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 20 Mar 2024 11:01:50 -0400 Subject: Restrict quotes#random to published quotes --- app/controllers/quotes_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/quotes_controller.rb') 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 end def random - picked = Quote.ids.sample + picked = Quote.where(state: :published).ids.sample redirect_to quote_url(picked) end -- cgit 1.4.1