mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-18 21:56:55 -04:00
Randomise the crops on the homepage
This commit is contained in:
committed by
pozorvlak
parent
705240014a
commit
a3a88c48de
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user