Add default search order for screenshots

This commit is contained in:
Christoph Haas 2021-02-24 23:50:31 +01:00
parent c6bea9b902
commit 5ce1df07f3

View file

@ -2,6 +2,11 @@ class Screenshot < ApplicationRecord
belongs_to :package, inverse_of: :screenshots
belongs_to :user, inverse_of: :screenshots
# Default sorting:
# - unapproved first (to see them at the top when moderating)
# - otherwise show newest first
default_scope { order(approved: :asc, created_at: :desc) }
# Paperclip
has_attached_file :image,
styles: { :large => '800x600>', :thumb => '160x120>' },