diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-03-20 11:01:50 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-03-20 11:01:50 -0400 |
| commit | 17c72a9bd8a624a2bc0aa4c806199ba8648ce4cc (patch) | |
| tree | b43debf495f2ab8732179bccd47e65fc5bb05a5b /app/controllers | |
| parent | 5462a1e56abf70486dc59593dde6ecb95a072026 (diff) | |
| download | thoughts-17c72a9bd8a624a2bc0aa4c806199ba8648ce4cc.tar.gz thoughts-17c72a9bd8a624a2bc0aa4c806199ba8648ce4cc.tar.bz2 thoughts-17c72a9bd8a624a2bc0aa4c806199ba8648ce4cc.zip | |
Restrict quotes#random to published quotes
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/quotes_controller.rb | 2 |
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 | ||
