From a3a88c48def7717d98b7afa653b35f5d6dc01dcf Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 23 Oct 2017 19:11:50 +1300 Subject: [PATCH] Randomise the crops on the homepage --- app/models/crop.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index 5f5eae30c..3294f2679 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -39,7 +39,7 @@ class Crop < ActiveRecord::Base scope :approved, -> { where(approval_status: "approved") } scope :rejected, -> { where(approval_status: "rejected") } - scope :interesting, -> { approved.has_photos } + scope :interesting, -> { approved.has_photos.randomized } scope :has_photos, -> { includes(:photos).where.not(photos: { id: nil }) } ## Wikipedia urls are only necessary when approving a crop